1、使用android studio捕获内存快照,或者使用adb shell 进入盒子使用am dumpheap <包名> <输出位置>
例如 am dumpheap com.starcor.hunan data/xxxx.hprof
2 将捕获的内存快照进行转换,使用hprof-conv.exe 目标文件 转换后文件。 hprof-conv.exe在android的sdk\platform-tools下
3将转换后的文件用MAT打开,选择OOL,使用select * from instanceof android.app.Activity 筛选出activity,右键activity罗列出它的引用,查看内存泄漏