eclipse 调试eclipse插件项目——PermGen空间,内存不足错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10976574/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 18:21:03  来源:igfitidea点击:

Debug eclipse plugin project -- PermGen space, out of memory error

eclipseeclipse-plugin

提问by Krishnaveni

I have a plugin project. When i debug this as an eclipse application, in the 2nd eclipse that opens, I want to open Project explorer window. As soon as I click on the button to do this, I get java.lang.OutOfMemoryError: PermGen space. I tried changing the PermGen space in the preference, but it did not help. Can any one please suggest a solution.

我有一个插件项目。当我将此作为 Eclipse 应用程序调试时,在打开的第二个 Eclipse 中,我想打开项目资源管理器窗口。一旦我单击按钮执行此操作,我就会得到java.lang.OutOfMemoryError: PermGen space. 我尝试在首选项中更改 PermGen 空间,但没有帮助。任何人都可以提出解决方案。

回答by Paul Webster

You should add the -XX:MaxPermSize=256mor 512m to the Window>Preferences>Java>Installed JREspreference page. Edit a JRE and add it to the Default VM arguments tab.

您应该将-XX:MaxPermSize=256m或 512m添加到Window>Preferences>Java>Installed JREs首选项页面。编辑 JRE 并将其添加到默认 VM 参数选项卡。

The eclipse native launcher uses the eclipse.ini to add extra permgen arguments to Oracle JVMs, but that information is not used during runtime launching.

eclipse 本机启动器使用 eclipse.ini 向 Oracle JVM 添加额外的 permgen 参数,但在运行时启动期间不使用该信息。

回答by mikrohelen

What if you try to extend the memory of eclipse when it starts. To do that simply open the .ini file (inside your eclipse folder) and edit the lines that refer to permSize and memory size: e.g.

如果您尝试在 eclipse 启动时扩展其内存会怎样。为此,只需打开 .ini 文件(在您的 eclipse 文件夹中)并编辑引用 permSize 和内存大小的行:例如

-XX:MaxPermSize=500m
-Xms500m
-Xmx2000m

回答by Manuel

If you don't want to set the permgen size for EVERY launch, you can also add the Parameter to the Debug Configuration.

如果您不想为每次启动设置 permgen 大小,您还可以将参数添加到调试配置中。

Run > Debug Configurations

Choose the "Eclpise Application"-Configuration on the right side and choose Argumentsin the Tabs.

选择右侧的“Eclpise 应用程序”-配置,然后Arguments在选项卡中进行选择。

Add -XX:MaxPermSize=512mto the VM arguments:

添加-XX:MaxPermSize=512m到 VM 参数:

-Dosgi.requiredJavaVersion=1.6 -Xms256m -Xmx4g -Dfile.encoding=UTF-8 -XX:MaxPermSize=512m