Hi all
    I am having problem with releasing memory problem, i have a
Hashmap in which i am adding Bitmap object, and the no. of bitmaps are
quite large. for this reason i am getting "OutOfMemoryError". So for
this i have decided to release Bitmap whic is least used from
Collection, on memory crunch or system getting low heap memory.
  For getting current memory available i used
"ActivityManager.MemoryInfo.availMem" but it gives total RAM size
memory, not Available Heap memory. And i found that this memory is not
getting updated on releasing  Bitmap from collection.

Then i have used these three method
"Debug.getNativeHeapAllocatedSize()"
"Debug.getNativeHeapFreeSize()"
"Debug.getNativeHeapSize()"

but found the NativeHeapSize goes on increasing upto some certain say
16MB changing after that an "outOfMemoryError" occur. In this also i
found that the NativeHeapAllocatedSize and getNativeHeapSize not
decreasing on releasing  Bitmap from collection.

So please help me for solving the problem if anyone facing the same
problem and fixed earlier it.

My problem is i want to calculate "Max Available application memory
allocated" and "currently available memory", for such that if
"currently available memory" goes beyond the Threshold memory i will
release some Bitmap from the collection and GC will reclaim the memory
and free it without generating error.

Thanks in advance
Anieeh

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to