Bitmaps in Android

The memory that backs a Bitmap object is allocated using native code (malloc()), rather than the Java new keyword. This means that the memory is managed directly by the OS, rather than by Dalvik.

The only real difference between the native heap and Dalvik’s heap is that Dalvik’s heap is garbage collected, and the native one isn’t.

For these purposes though, here’s not much difference. When your Bitmap object gets garbage collected, it’s destructor will recycle the associated memory in the native heap.

Source:

Leave a Comment