thest1 / LazyList

Lazy load of images in Android
http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012
MIT License
1.2k stars 497 forks source link

Bitmap exceeds VM budget: potential issue #2

Closed hyoun98 closed 13 years ago

hyoun98 commented 13 years ago

Hi,
While this is not your issue per se, I was wondering if you could comment on this. I have a listview which contains textviews and imageview which are both loaded from the network. After continuous opening and closing the listview activity, but retrieving different data sets, I run into this error message and the app then closes. I've tried such things like:

a) forcing a gc on the OnDestroy, OnPause events b) nulling out references to the imageviews on the OnDestroy and OnPause events c) using decodeFileDescription instead of decodeStream (see Comment 94 on the link below) d) forcing a bitmap recycle when doing the gc and nulling references (see Comment 90)

None of these seem to be helping any.

There is a long thread about this problem which Google is well aware. Just wondering if you had any thoughts to this: Btw, your code works great. Thanks for your help.

http://code.google.com/p/android/issues/detail?id=8488

hyoun98 commented 13 years ago

Hi. I found the root cause of the issue that I had encountered. As done in your example MainActivity.java, I had neglected to call "stopThread()" in the onDestroy() routine as you did. Regards.

thest1 commented 13 years ago

Don't think stopThread can affect memory usage. I guess there's still a memory leak.