Android Bitmap Freeing Memory - None Of This Works
I get 'bitmap size exceeds VM budget', eventually with my app. So I added all of these things to help alleviate the increasing memory footprint BitmapFactory.Options options = new
Solution 1:
If you want to really make sure those Bitmaps
are freed, you have to call recycle()
on those Bitmaps
that are no longer needed. If you need all of them, then recycle least recently used ones (and re-load them, again when needed).
Solution 2:
You should try to use drawable.setCallback(null);
when you don't need a drawable anymore, because even if you're using a WeakHashMap, they can still be attached to the context through their callback attribute.
See this
Solution 3:
I was dealing with ImageView and i solved the memory problem using imageView.clearAnimation(); before to assign the new bitmap and now i have no memory error.
Post a Comment for "Android Bitmap Freeing Memory - None Of This Works"