Obsolete
Status Update
Comments
ge...@gmail.com <ge...@gmail.com> #2
*bumper*
ty...@gmail.com <ty...@gmail.com> #3
I simply have a visible progress bar, and memory usage slowly and steadily increases forever. The allocation tracker blames the progress bar.
de...@gmail.com <de...@gmail.com> #4
I got the same problem
ko...@gmail.com <ko...@gmail.com> #5
Got same problem.. Issue is also on Marshmallow release.
ko...@gmail.com <ko...@gmail.com> #6
Update on this case. setting View.LAYER_TYPE_SOFTWARE cleared problem and no leak anymore.
mProgress.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mProgress.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
sa...@google.com <sa...@google.com> #7
Thank you for your feedback. We assure you that we are doing our best to address the issue reported, however our product team has shifted work priority that doesn't include this issue. For now, we will be closing the issue as won't fix obsolete. If this issue currently still exists, we request that you log a new issue along with latest bug report here https://goo.gl/TbMiIO .
Description
For example, let's asume that the activity_main xml defines a simple horizontal progress bar. This code causes a memory leak.
package package.test;
import android.os.CountDownTimer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ProgressBar;
public class MainActivity extends AppCompatActivity {
private ProgressBar progressBar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
progressBar = (ProgressBar) findViewById(R.id.progressBar);
progressBar.setMax(1000);
CountDownTimer timer = new CountDownTimer(60*60000, 10) {
@Override
public void onTick(long millisUntilFinished) {
if(progressBar.getProgress() >= progressBar.getMax()) progressBar.setProgress(0);
progressBar.incrementProgressBy(1);
}
@Override
public void onFinish() {
}
}
timer.start();
}
}
The problem is not caused by the timer, or by the update interval though: even a simple while loop will cause a spike. in the memory graph:
...
progressBar.setMax(1000);
for(int i = 0; i < 1000; i++) progressBar.setProgress(i);
...
This problem may also be able to cause a crash: on Google play I have received a crash report for Galaxy S4 Active (Android 5.0), though I have not been unable to reproduce it, thus I am not certain that it is directly related to this particular bug.
java.lang.OutOfMemoryError: Failed to allocate a 23040012 byte allocation with 997744 free bytes and 974KB until OOM
...