2010년 8월 23일 월요일

Garbage collecting when using Bitmap in Android

This article is related to the previous one, which also deals with memory leak in Android.

Today, I found a simple stupid way but useful method.

In order to release Bitmap, many articles suggest recycle(), but can be used only some activities are destroyed. If an activity is not terminated and just some of large Bitmap images are loaded, you can use
'System.gc()'
to execute garbage collector.
This is somewhat not intuitive but works well.


댓글 없음:

댓글 쓰기