简体   繁体   English

Eclipse 无法解析堆转储

[英]Eclipse can't parse heap dump

When I try to open my .hprof file(800 MB), i get:当我尝试打开我的 .hprof 文件(800 MB)时,我得到:

An internal error occurred during: "Parsing heap dump from 'D:\\Workspace\\Java\\MemoryLeaks\\java_pid9004.hprof'".在以下过程中发生内部错误:“解析来自 'D:\\Workspace\\Java\\MemoryLeaks\\java_pid9004.hprof' 的堆转储”。

I tried to increase heap size up to -Xmx2048m, but this doesn't help.我试图将堆大小增加到 -Xmx2048m,但这无济于事。

Eclipse MAT – Increasing Heap size Eclipse MAT – 增加堆大小

If you are analyzing a heap dump of size, say 800 mb, allocate at least additional 800mb space for Eclipse MAT.如果您正在分析大小为 800 mb 的堆转储,请至少为 ​​Eclipse MAT 分配额外的 800mb 空间。 If you can allocate more heap space, then it's more the merrier.如果你可以分配更多的堆空间,那就更好了。 You can allocate additional heap space for Eclipse MAT tool, by editing MemoryAnalyzer.ini file.您可以通过编辑MemoryAnalyzer.ini文件为 Eclipse MAT 工具分配额外的堆空间。 This file is located in the same folder where MemoryAnalyzer.exe is present.此文件位于存在 MemoryAnalyzer.exe 的同一文件夹中。 To the MemoryAnalyzer.ini you will add -Xmx1600m at the bottom.对于 MemoryAnalyzer.ini,您将在底部添加 -Xmx1600m。

Below is a sample MemoryAnalyzer.ini file with added -Xmx value:下面是添加了 -Xmx 值的示例 MemoryAnalyzer.ini 文件:

-startup
plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library 
  plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-vmargs
-Xmx1600m

On the other hand, you may consider using other memory analysis tools such as: HeapHero.io and JHat .另一方面,您可以考虑使用其他内存分析工具,例如: HeapHero.ioJHat However please be advised that JHat doesn't work well with large size heap dumps and takes long time to load.但是请注意,JHat 不适用于大型堆转储,并且需要很长时间才能加载。

800MB exactly? 800MB 准确吗? Are you sure there isn't more to the heapdump and you aren't just using a chunk of it?您确定堆转储没有更多内容并且您不只是使用其中的一大块吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM