eclipse 如何将android中的堆转储转换为eclipse格式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14168485/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to convert a heap dump in android to eclipse format
提问by Edmund Rojas
Im attempting to analyze a memory leak that has been driving me crazy for weeks, I found out about the eclipse MATtool that helps you to figure out what is wrong, the problem is every single tutorial I have found says that I need to convert the format of the file from dalvik to HPROFformat, however not one single tutorial I can find explains how to actually do it, instead I get vague things like this
我试图分析数周以来一直让我发疯的内存泄漏,我发现了 eclipseMAT工具可以帮助您找出问题所在,问题是我发现的每个教程都说我需要转换格式从 dalvik 到HPROF格式的文件 ,但是我找不到一个教程解释了如何实际操作,相反,我得到了这样的含糊不清的东西
Now the file you will get does not conform to the "standard" Sun .hprof format but is written in Dalvik's own format and you need to convert it:
现在您将获得的文件不符合“标准”Sun .hprof 格式,而是以 Dalvik 自己的格式编写的,您需要对其进行转换:
hprof-conv heap-dump-tm-pid.hprof 4mat.hprof
hprof-conv heap-dump-tm-pid.hprof 4mat.hprof
what does that actually mean? what do I click? where do I go? Im totally lost and frustrated, any help will go a long way, thanks.
这实际上是什么意思?我点击什么?我要去哪?我完全迷失和沮丧,任何帮助都会大有帮助,谢谢。
回答by Oleg Vaskevich
Sounds like you need to use the hprof-convtool that's located in [Android-SDK]\platform-tools.
听起来您需要使用hprof-conv位于[Android-SDK]\platform-tools.
To do this on Windows:
要在 Windows 上执行此操作:
- Press WINKEY+Rand type in
cmd Type in:
cd "C:\android-sdk\platform-tools"(or whichever directory contains your Android sdk)Assuming you have your Dalvik file on the Desktop (I'm just guessing the directory), type in:
hprof-conv "C:\Users\Edmund\Desktop\heap-dump-tm-pid.hprof" "C:\Users\Edmund\Desktop\4mat.hprof"- This will generate the standard format HPROF file that you can use called
4mat.hprof
- 按WINKEY+R并输入
cmd 输入:
cd "C:\android-sdk\platform-tools"(或任何包含您的 Android sdk 的目录)假设你在桌面上有你的 Dalvik 文件(我只是猜测目录),输入:
hprof-conv "C:\Users\Edmund\Desktop\heap-dump-tm-pid.hprof" "C:\Users\Edmund\Desktop\4mat.hprof"- 这将生成您可以使用的标准格式 HPROF 文件,称为
4mat.hprof
回答by eyecatchUp
Just to be said: You don't explicitly need to convert the .hproffile using hprof-conv. MATdoes this for you automatically- as described here. In Eclipse,
只想说:您不需要明确地使用.hprof文件转换.hprof文件hprof-conv。MAT会自动为您执行此操作- 如此处所述。在日食中,
- open the PreferencesWindow,
- navigate to Android> DDMS
- and change the HPROF actionto "Open in Eclipse".
- 打开首选项窗口,
- 导航到Android> DDMS
- 并将HPROF 操作更改为“在 Eclipse 中打开”。


