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 r开发者_运维技巧ecycle 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?
No you don't need to, the GC will do it for you.
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
Recycle ImageView's Bitmap
精彩评论