Home > Tutorials > Bitmap and memory leak!

Bitmap and memory leak!

Whenever using a Bitmap object, it consumes the heap memory! So if your code simply just declares and use it without release its memory, you would face memory leak problem.

It’s men

Remember to always free Bitmap objects memory before finishing your application or whatever objects containers.

Bitmap image = ..... (whatever)


if(image != null) {


image = null;


It’s mentioned here on Android Documentation References: Bitmap.recycle()



Pete Houston

Categories: Tutorials Tags: , , , ,
  1. April 1, 2012 at 1:40 pm

    ok. thanks

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: