Reputation: 729
Frequently we get image from server as byte stream, then we create Bitmap and assign it to ImageView object.
When I need to release memory, I can drop all ImageView references to null, letting the gc do the work.
But question is, in this way, I did not call the recycle method of Bitmap since I did not keep references of it. So I wonder that, do I need to maintain all the references of Bitmap, to recycle them in the future?
Upvotes: 1
Views: 1866
Reputation: 23952
It's better to do so, because Bitmap object itself is poor candidate for GC (since memory allocated in native heap).
Also you should recycle your ImageView bitmap, before using the new one
Upvotes: 0