Android Studio 4.0.2 正在从不为空的内存中导出空的 hprof 文件。 探查器正确显示内存,但我想使用 MAT 来分析堆,因为 Android Studio 没有以易于解析的方式提供信息。
有办法解决这个问题吗?
最佳答案
我知道这是一篇较旧的文章,但您是否尝试过使用 ADB 来收集应用程序的转储堆?
adb shell ps | grep
app-name
adb shell am dumpheap
pid
/data/local/tmp/android.hprofadb pull /data/local/tmp/android.hprof
然后您将需要使用 HPROF-Converter 在 Android Studio 中查看 https://stuff.mit.edu/afs/sipb/project/android/docs/tools/help/hprof-conv.html
关于android-studio - Android Studio 堆转储为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64364476/