简体   繁体   English

Eclipse Memory Analyser,但总是显示发生内部错误?

[英]Eclipse Memory Analyser,but always shows An internal error occurred?

java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid2584.hprof ...
Heap dump file created [106948719 bytes in 4.213 secs]
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2760)
at java.util.Arrays.copyOf(Arrays.java:2734)
at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
at java.util.ArrayList.add(ArrayList.java:351)
at Main.main(Main.java:15)

But when i open head dump java_pid2584.hprof via Eclipse Memory Analyser,but there is always message:但是当我通过 Eclipse Memory Analyser 打开 head dump java_pid2584.hprof 时,但总是有消息:

An internal error occurred during: 
"Parsing heap dump from **\java_pid6564.hprof'".Java heap space

The problem is that Eclipse Memory Analyser does not have enough heap space to open the Heap dump file.问题是 Eclipse Memory Analyzer 没有足够的堆空间来打开堆转储文件。

You can solve the problem as follows:您可以按如下方式解决问题:

  1. open the MemoryAnalyzer.ini file打开MemoryAnalyzer.ini文件

  2. change the default -Xmx1024m to a larger size将默认的-Xmx1024m更改为更大的尺寸

Note that on OS X, to increase the memory allocated to MAT, you need to right-click mat.app and show the package contents.请注意,在 OS X 上,要增加分配给 MAT 的内存,您需要右键单击mat.app并显示包内容。 The MemoryAnalyzer.ini file is under /Contents/Eclipse . MemoryAnalyzer.ini文件位于/Contents/Eclipse

Solution for same issue for Memory Analyzer plugin in Eclipse in MAC OS X El Capitan. MAC OS X El Capitan 中 Eclipse 中内存分析器插件相同问题的解决方案。

I was facing the same issue but with the eclipse plugin and I did not have any Memory Analyzer App in Applications Folder.我遇到了同样的问题,但是使用 eclipse 插件,我在应用程序文件夹中没有任何内存分析器应用程序。 The solution which worked for me was:对我有用的解决方案是:

  1. Right Click on Eclipse icon and select Show Package Content.右键单击 Eclipse 图标并选择显示包内容。
  2. Go to Contents>Eclipse转到目录>Eclipse
  3. Open Eclipse.ini打开 Eclipse.ini
  4. Change value -Xmx1024m to -Xmx2048m将值 -Xmx1024m 更改为 -Xmx2048m
  5. Restart Eclipse重启 Eclipse

On OS X 11.5 (El Cap) modifying MemoryAnalyzer.app/Contents/MacOS/MemoryAnalyzer.ini does not work!在 OS X 11.5 (El Cap) 上修改MemoryAnalyzer.app/Contents/MacOS/MemoryAnalyzer.ini不起作用! This is because it's looking for the MemoryAnalyzer.ini in a different place.这是因为它在不同的地方寻找MemoryAnalyzer.ini

On my computer, it was looking for:在我的电脑上,它正在寻找:

MemoryAnalyzer.app/Contents/Eclipse/MemoryAnalyzer.ini but the real .ini file was: MemoryAnalyzer.app/Contents/MacOS/MemoryAnalyzer.ini . MemoryAnalyzer.app/Contents/Eclipse/MemoryAnalyzer.ini但真正的 .ini 文件是: MemoryAnalyzer.app/Contents/MacOS/MemoryAnalyzer.ini

In order for your changes to take effect, copy the existing .ini file into the new location.为了使您的更改生效,请将现有的.ini文件复制到新位置。

To find where MemoryAnalyzer is looking for the ini file, you can run:要查找 MemoryAnalyzer 在哪里寻找 ini 文件,您可以运行:

sudo su
cd ...MemoryAnalyzer.app/Contents/MacOS/
dtruss ./MemoryAnalyzer 2>&1 | grep ini

If Memory Analyser is used from Eclipse, then edit your eclipse.ini file to increase the vm argument to -Xmx1024m or higher.如果从 Eclipse 使用内存分析器,则编辑 eclipse.ini 文件以将 vm 参数增加到 -Xmx1024m 或更高。 This worked for me.这对我有用。 http://wiki.eclipse.org/index.php/MemoryAnalyzer/FAQ#Out_of_Memory_Error_while_Running_the_Memory_Analyzer http://wiki.eclipse.org/index.php/MemoryAnalyzer/FAQ#Out_of_Memory_Error_while_Running_the_Memory_Analyzer

As suggested by others, its two step simple process:-正如其他人所建议的,它的两步简单过程:-

  1. open the MemoryAnalyzer.ini file from your MAT installation directory.从 MAT 安装目录中打开 MemoryAnalyzer.ini 文件。

  2. change the default -Xmx1024m to a larger size for eg if you have to analyze a 4GB heap dump then you can replace -Xmx1024m with -Xmx5g or -Xmx6g将默认的 -Xmx1024m 更改为更大的大小,例如,如果您必须分析 4GB 堆转储,那么您可以将 -Xmx1024m 替换为 -Xmx5g 或 -Xmx6g

For more details refer:- https://better-coding.com/solved-eclipse-mat-java-heap-space-error/有关更多详细信息,请参阅:- https://better-coding.com/solved-eclipse-mat-java-heap-space-error/

If you are using Mac, try running the executable inside the mat.app 'folder' with -data option, by which you can specify a writable path:如果您使用的是 Mac,请尝试使用 -data 选项运行 mat.app 'folder' 中的可执行文件,您可以通过该选项指定可写路径:

cd mat.app/Contents/MacOS
./MemoryAnalyzer -data <writable_path>

For my experience add in MemoryAnalyzer.ini , Xms and Xmx to the max as your materiel possibilities.根据我的经验,将MemoryAnalyzer.ini 、 Xms 和 Xmx 添加到最大作为您的材料可能性。 G1GC is faster and -XX:-UseGCOverheadLimit is need because gc usage can be high and time consuming, and maybe -XX:+UseStringDeduplication is the key to consume less memory G1GC 更快,需要 -XX:-UseGCOverheadLimit 因为 gc 使用率高且耗时,也许 -XX:+UseStringDeduplication 是消耗更少内存的关键

-vmargs
-Xms8g
-Xmx8g
-XX:-UseGCOverheadLimit
-XX:+UseG1GC
-XX:+UseStringDeduplication

I tried all the solutions here as well, while still getting the same error and the reason eclipse was trying to open the .hprof file as a text file due to wrong or unknown file type / editor association.我在这里也尝试了所有解决方案,但仍然遇到相同的错误,这是由于错误或未知的文件类型/编辑器关联,eclipse 试图将 .hprof 文件作为文本文件打开的原因。

Solution: Right click on the file, select open with, then select Others, and select Eclipse Memory Analyzer.解决方法:右键文件,选择打开方式,然后选择Others,选择Eclipse Memory Analyzer。

Worked with 700MB dump, and worked with 2G dump on an eclipse heap of about 600M.使用 700MB 转储,并在大约 600M 的 eclipse 堆上使用 2G 转储。

An internal error has occurred.发生内部错误。 Java heap space Java堆空间

Ans: GO to Your Project Work space open .setting folder Delete all file of .setting folder. Ans:转到您的项目工作空间,打开 .setting 文件夹删除 .setting 文件夹中的所有文件。 after you can compile now there is no error Like Heap space Enjoy :)现在可以编译后没有错误喜欢堆空间享受:)

You may reduce your application memory limit, and then again take a dump.您可以减少应用程序内存限制,然后再次进行转储。 Eclipse Memory Analyser puts dump file to memory - I suspect that your Eclipse has less memory than the limit of application. Eclipse Memory Analyzer 将转储文件放入内存 - 我怀疑您的 Eclipse 的内存少于应用程序的限制。

You can also do the opposite and increase the memory limit for Eclipse, but if your application works on a server, it will be hard to match in size of memory.您也可以反其道而行之,增加 Eclipse 的内存限制,但如果您的应用程序在服务器上运行,则内存大小将难以匹配。

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

相关问题 Eclipse 内存分析器 - 尝试获取堆转储时出错 - Eclipse memory analyser - error on trying to acquire heap dump JRE 系统库在 Eclipse 中总是未绑定? (在“启动主程序”期间发生内部错误。模型不适用于 helloWorld) - JRE System Library is always unbound in Eclipse? (An internal error occurred during: "Launching Main". Model not available for helloWorld) 在Eclipse中启动testng时发生内部错误 - An internal error occurred during launching testng in eclipse 使用Eclipse内存分析器分析堆转储 - analyzing heap dump with eclipse memory analyser 交织eclipse内存分析器的输出 - Interpereting the output of eclipse's memory analyser 在Android中启动活动-Eclipse总是显示错误 - Starting activity in Android - Eclipse always shows an error Eclipse - JUnit - 在“启动 MyMavenModule”期间发生内部错误。 空指针异常 - Eclipse - JUnit - An internal error occurred during: “Launching MyMavenModule”. NullPointerException JUnit4 + Eclipse“启动期间发生内部错误” - JUnit4 + Eclipse “An internal error occurred during Launching” Eclipse Memory Analyzer:java.lang.OutOfMemoryError:Java堆空间 - Eclipse Memory Analyser : java.lang.OutOfMemoryError: Java heap space 如何使用Eclipse Memory Analyzer Tool(MAT)分析hashmap - How to use Eclipse Memory Analyser Tool (MAT) for analysing a hashmap
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM