Android_Mat_工具使用

Android_Mat_工具使用

抓取hprof

adb shell am dumpheap [pid] /data/local/tmp/[pid].hprof
hprof-conv 3725.hprof 3725.mat.hprof
adb shell am dumpheap 9384 /data/local/tmp/9384_02.hprof

使用MAT

这里需要修改,改为144就可以了.

private static final int DUMPSYS_ENTRY_COUNT_LIMIT = 14400; // 12 hours on 3 second poll

查找下面这段LOG

fling expand=false aboveThreshold=false thresholdNeeded=false screenOnFromTouch=false

参考文档

https://stackoverflow.com/questions/25795458/is-it-possible-to-trigger-an-android-heap-dump-from-the-command-line

https://stackoverflow.com/questions/6483714/live-memory-analysis-tool-for-android/6483906#6483906

https://developer.android.com/studio/profile/investigate-ram#hdanalyze