- Dalvik VM will dump hprof file within /data/misc folder if SIGUSR1 and/or SIGQUIT signal is received. Manually send SIGUSR1 to process: kill -10 pid.
- The android provides monkey tool (random testing tool), with --hprof option will generate hprof file within /data/misc folder.
- In cupcake release, a new API has been introduced to generate a dump programmatically, the static method dumpHprofData(String fileName) of the Debug class. Example: Debug.dumpHprofData("xxx.hprof").
- The folder /data/misc shall have 777 permissions.
- The hprof file format is heap-dump-tm
-pid .hprof-head and heap-dump-tm -pid .hprof if android 1.1 release is used. - The hprof file format is heap-dump-tm
-pid .hprof if android 1.5 release is used. - If two files are generated, you need to join the two files into one: type heap-dump-tm
-pid .hprof-head > dump.hprof; type heap-dump-tm -pid .hprof >> dump.hprof. - Convert the hprof to standard hprof format: hprofconv dump.hprof out_dump.hprof
- Use JProfiler, Eclipse MAT, or other tools to open out_dump.hprof. I tried JProfiler and got the same problems as indicated in http://osdir.com/ml/android-porting/2009-04/msg00597.html.
- Eclipse MAT: http://www.eclipse.org/mat/
- MAT standalone: MemoryAnalyzer-Incubation-0.7.0.20081210-win32.win32.x86.zip
- Hprofconv: http://bigflake.com/HprofConv.c.txt