• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Strange Memory Issue, Please Help!

schic

Lurker
I have an Application running on 2.3 which handles a lot of Bitmaps. I know that i have to call Bitmap.recycle() in order to get the allocated memory back. I do this for really every Bitmap i dont need anymore. So i should not run into memory Problems (theoretically). My DDMS reports an Error when i want to load a Bitmap when i reach about 16000K of external Memory (the native heap). After i recycled the Bitmaps, the native Heap is freed again. BUT: The maximal Limit of external Memory i can allocate from now on has shrunken!! Now i get the out of Memory - Message already at 14000K ... I can run the game as described above and at some point i can allocate almost no more external memory without getting an Error EVEN IF i allocated just ~11000K. What is going on here? I can do this until i get a InflateException when i use the Inflater on a layout (caused by out of memory) -> EVEN IF MY DDMS REPORTS AVAILABLE MEMORY! The maximal native heap i could allocate at the start of the app was around 16000 and now around 11000. I cant analyze this Memory Problem properly, because the heap dump does not contain the native heap objects!
 
Back
Top Bottom