Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tutorials or examples for Android memory debugging

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.

like image 437
JaimeBarrachina Avatar asked Feb 26 '11 16:02

JaimeBarrachina


3 Answers

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

like image 93
QQQuestions Avatar answered Oct 31 '22 19:10

QQQuestions


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/

like image 3
Will Tate Avatar answered Oct 31 '22 19:10

Will Tate


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

like image 3
Romain Guy Avatar answered Oct 31 '22 21:10

Romain Guy