http://stackoverflow.com/questions/25795458/is-it-possible-to-trigger-an-android-heap-dump-from-the-command-line
watch this video from 35 minutes Android Development Tools
from code you can use
Debug.dumpHprofData()
from adb you can use kill -10 explain well here -> Dalvik Heap Profiling
adb am dumpheap
use this link to get more info heap-profiling
From a shell you can do the following to get a heap dump for the application using adb.
Note: Replace 19000 with the process ID of your running application. The filepath must be a filepath which your application has write access to on the Android device.
Create a heap dump:
Pull the file to your machine:
Convert to a hprof file readable by an analyzer:
adb shell am dumpheap 19000 /sdcard/Documents/android.hprof
Pull the file to your machine:
adb pull /sdcard/Documents/android.hprof
Convert to a hprof file readable by an analyzer:
hprof-conv android.hprof mat.hprof
Tips: Get process ID of your application:
adb shell ps | grep com.sample.application | cut -c10-15
Get process ID and dump heap:
adb shell am dumpheap `adb shell ps | grep com.sample.application | cut -c10-15` /sdcard/Documents/android.hprof
No comments:
Post a Comment