Skip to content
Advertisement

Android Resources Class Memory Usage

I’m making modifications to the Android 4.0 launcher and I have been running into many OutOfMemoryErrors. Since the 4.0.3 update it got much worse (or started, it seems before it was fine, but I never got to test properly) and I have tried many many things to fix it. The error is also in the stock launcher without my modifications.

I looked at the heap hprof in the Eclipse Memory Analyzer and noticed that the system Resources class was taking 50% of the memory. Almost all of it was Bitmaps including some bitmaps that were 1mb 512x512px. Since my phone is 400×800, I don’t see why it would have a resource at that resolution. Then there were there more than 800 other bitmaps as well but these were more reasonable sizes.

The app doesn’t contain 800 resources, so is it possible that these are from other packages? I know the app does load icons and widget previews from other apps, but that still isn’t up to 800 and even if it is part of them, why is it still being kept in memory?

I have uploaded the hprof file to http://176.31.247.124/nebkat/heap.hprof if it is needed.

Advertisement

Answer

Turns out it was a problem in CyanogenMod. It has been fixed now.

Advertisement