From the Bitmap.recycle document:
This is an advanced call, and normally need not be called, since the normal GC process will free up this memory when there are no more references to this bitmap.
Thus, for weak hold bitmap is enough. If for some reason you need to aggressively free this resource, you're out of luck with a weak link.
EDIT
I am not familiar with the Bitmap implementation in android, but what can happen causes one to deal with Bitmap resources explicitly, is the fact that some memory is not created on the heap. Thus, the process can end without memory, while there is no need for a GC. Imagine a small object containing a large piece of memory laid out from another place. Finalizing the object can be prepared to free up memory, but there is no reason for the VM for the GC, so its own memory is "lost".
But in this case, a weak link will not help either, since it is processed only after gc. The only thing that helps here is the explicit “recycling”, possibly through reference counting.
mtraut
source share