I'm facing some troubles with memory consumption while developing 2D game using libGDX.

It's a 2D game with rich graphic content - there are many textures, animations, fonts etc. For some reasons all graphic content is loaded on game start - and here is a problem with memory. I've tested memory allocation (native & heap) on different devices and got different results: (I've divided all devices for groups by textures sizes)

Group 1 (textures adopted for ~840*480 screens)

HTC Desire (Froyo): 178Mb(native) - 12Mb(heap) - application loads successfully

HTC One V (ICS): 30Mb(native) - 12Mb(heap) - application loads successfully

HTC Desire S (Jelly Bean): 30Mb(native) - 12Mb(heap) - application loads successfully

Group 2 (textures adopted for ~1366*768 screens)

Samsung(Google) Galaxy Nexus 329Mb(native) - 18Mb(heap) - works perfectly

Galaxy TAB (Honeycomb) 164Mb(native) - 10Mb(heap) - application crashes (Surface.OutOfResouresException).

I think there could be some significant memory management difference on all android versions, which brings me these troubles.

Can anyone explain what exactly happens while loading textures on android 3.x? Or maybe post some links to understand what need to be done to resolve this problem.

SOME UPDATE

Toady I'd made some additional tests on 3.x emulators (I know this is not best way, but logs was similar on emu and Galaxy Tab before)

  1. I've run game with textures adopted for 1024*600 - app crashes on 80% loading resources (158 native memory allocation)
  2. With textures for 800*480 - app crashes on 100% loading (145Mb native memory allocation)

And finally I have run app on new Google Nexus

Edit
Report