I'm analyzing memory usage of our app, and has found strange Drawables
, which constantly "eats" few megabytes of heap. Here are few screenshots from MAT:
Dominator tree with 2 pretty big bitmaps
Path to GC roots for one of above bitmaps
This bitmaps always appears in heap dumps from my phone (Samsung Galaxy Nexus, OS 4.1.1), no matter how long or how intensive I use our app.
I've already tried to search the source of this bitmaps using MAT - with no luck. All usefull information I was able to find waswidth
and height
of bitmaps, it's both 512x512:
But our app doesn't have any single 512x512 drawables. I assume this is some "system" drawables. But what exactly? Why them so big?
I've also looked at source code of android.content.res.Resources
class, searching usage of sPreloadedDrawables
field - also with no luck. All I get from memory dump - is key
from sPreloadedDrawables
array, but I can't determine filename or resource id from this key.
So, my questions is:
how can I determine names or IDs of this bitmaps?
what for this huge bitmaps are loaded and why they always stays in memory?
Update:
I have found a way to look at this bitmaps from memory dump. This two bitmaps is a simple gradients, one black, other - white. I suppose this is resources for Holo.Light
and Holo.Dark
ICS themes. But my second question is still actual: why this bitmaps are always stays in memory? Is there any way to upload or recycle them?