当我试图用Memory Analyzer打开HPROF文件(由Debug.dumpHprofData创建)时,我得到了以下异常:
java.io.IOException: Unknown HPROF Version (JAVA PROFILE 1.0.3)
at org.eclipse.mat.hprof.AbstractParser.readVersion(AbstractParser.java:124)
at org.eclipse.mat.hprof.Pass1Parser.read(Pass1Parser.java:69)
at org.eclipse.mat.hprof.HprofIndexBuilder.fill(HprofIndexBuilder.java:65)
at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.parse(SnapshotFactoryImpl.java:203)
at org.eclipse.mat.parser.internal.SnapshotFactoryImpl.openSnapshot(SnapshotFactoryImpl.java:114)
at org.eclipse.mat.snapshot.SnapshotFactory.openSnapshot(SnapshotFactory.java:143)
at org.eclipse.mat.snapshot.SnapshotFactory.openSnapshot(SnapshotFactory.java:123)
at org.eclipse.mat.ui.snapshot.ParseHeapDumpJob.run(ParseHeapDumpJob.java:56)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)我该如何解决这个问题?
发布于 2011-06-03 03:03:05
你从Android得到的hprof文件有android特有的格式。你应该转换的hprof文件从安卓操作系统到标准的hprof格式。为此,您可以使用位于AndroidSDK/tools/hprof-conv的hprof-conv工具。
例如:
hprof-conv android.hprof mat.hprof然后在内存分析器中打开mat.hprof。
编辑: hprof-conv可能位于某些包中的AndroidSDK/platform-tools/下。
发布于 2012-02-28 04:42:33
如果您使用的是Eclipse,只需更改以下内容:
Eclipse打开首选项(从窗口菜单)
发布于 2015-03-31 04:41:15
hprof-conv工具位置已更改。
它现在位于AndroidSDK/platform-tools/hprof-conv
https://stackoverflow.com/questions/6219049
复制相似问题