Universal Image Loader supports 1.5+ Android versions. UIL tries to prevent OOM by using of weak references and own logic for caching and reference cleaning. For effective memory management in Android versions prior to 3.0 we need use Bitmap.recycle()
to clear native memory. But UIL can't do it itself because it can't know when Bitmap is not visible and not referenced by anyone.
User should do recycling yourself, when he know that he can do it.
Also there are some UIL configuration tuning is possible for preventing OOM.
P.S.: How to define if Bitmap is in UIL memory-cache:
Bitmap bmp = ...;
boolean isBitmapInCache = false;
MemoryCacheAware<String, Bitmap> memoryCache = ImageLoader.getInstance().getMemoryCache();
for (String key : memoryCache.keys()) {
if (bmp == memoryCache.get(key)) {
isBitmapInCache = true;
break;
}
}
if (!isBitmapInCache) {
// You can recycle bitmap
}