5

So, I'm blowing up the heap somewhere in my logic thread of the Android game I'm making, it plays fine until the heap randomly grows from ~3MB to almost 30MB, whereas the game hangs (quite understandably). I've been hacking away at this bug for a few days, turning systems on and off, and playing around with both DDMS and the Eclipse Memory Analyzer, and have found nothing, quite probably because of my lack of understanding on how to use these tools.

Anyone knows some good tutorials / examples for android memory debugging? Specifically of the heap.

Thanks guys.

trincot
  • 317,000
  • 35
  • 244
  • 286
JaimeBarrachina
  • 430
  • 8
  • 21

4 Answers4

6

This one seems based on that eclipse article but really focused on Android: http://ttlnews.blogspot.com/2010/01/attacking-memory-problems-on-android.html

QQQuestions
  • 736
  • 8
  • 7
3

This article describes pretty well how to create a heap dump and analyze it using Eclipse MAT. This will help you find the most likely suspects for memory leaks pretty quickly.

HERE: http://dev.eclipse.org/blogs/memoryanalyzer/2008/05/27/automated-heap-dump-analysis-finding-memory-leaks-with-one-click/

Will Tate
  • 33,439
  • 9
  • 77
  • 71
3

In DDMS you can use the allocation tracking tab to see where you're allocating memory in your code.

Romain Guy
  • 97,993
  • 18
  • 219
  • 200
1

Though not so much of a debugging answer this will definitely help.

The only tool that i am aware of is the ddms tool , the profiling feature may help you track down this issue

Community
  • 1
  • 1
Reno
  • 33,594
  • 11
  • 89
  • 102
  • Already tried the DDMS tool, and it served to figure out that the problem was actually a heap problem, but besides that I couldn't get more information out of it. Thanks for the links tough – JaimeBarrachina Feb 28 '11 at 18:29