Android: How does Bitmap recycle() work?

The first bitmap is not garbage collected when you decode the second one. Garbage Collector will do it later whenever it decides. If you want to free memory ASAP you should call recycle() just before decoding the second bitmap.

If you want to load really big image you should resample it. Here’s an example: Strange out of memory issue while loading an image to a Bitmap object.

Leave a Comment