java.lang.OutOfMemoryError: Eclipse Helios 中的 PermGen 空间
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6537217/
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
java.lang.OutOfMemoryError: PermGen space in Eclipse Helios
提问by Joeblackdev
I have created an Xtext plugin in eclipse. Every time I launch it as an 'Eclipse Application' via the context menu, I get a few moments grace before the new Eclipse instance crashes. I switch back to the original instance and in the console window I see
我在 eclipse 中创建了一个 Xtext 插件。每次我通过上下文菜单将它作为“Eclipse 应用程序”启动时,我都会在新的 Eclipse 实例崩溃之前获得一些时间。我切换回原始实例并在控制台窗口中看到
Root exception:
java.lang.OutOfMemoryError: PermGen space
I have looked back at some solutions in the forums but a lot relate to tomcat. Can someone give me a few suggestions as to how I could fix this? I am using Eclipse helios. My 'eclipse.ini' file looks like:
我回顾了论坛中的一些解决方案,但很多都与 tomcat 有关。有人可以就如何解决这个问题给我一些建议吗?我正在使用 Eclipse helios。我的“eclipse.ini”文件如下所示:
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m
The machine I am running eclipse on has just about 4GB of RAM
我正在运行 eclipse 的机器只有大约 4GB 的内存
======================================================================
================================================== ====================
Update: I hope this is helpful to anyone who may have the same problem.
I followed the instructions hereand tried setting the
-XX:MaxPermSize=256m
in my eclipse.ini file. This did not work. Eventually,
I had to uninstall java sdk (I was using the latest jdk1.6.0_26) and I installed
an older version (jdk1.6.0_20) from here. I then set -XX:MaxPermSize=256m
in my eclipse.ini and it now looks like the following:
更新:我希望这对可能有同样问题的人有所帮助。我按照此处的说明操作并尝试
-XX:MaxPermSize=256m
在我的 eclipse.ini 文件中设置 。这没有用。最终,我不得不卸载 java sdk(我使用的是最新的 jdk1.6.0_26)并从这里安装了旧版本(jdk1.6.0_20)。然后-XX:MaxPermSize=256m
我在我的 eclipse.ini 中设置,它现在看起来像下面这样:
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.defaultAction
openFile
-vmargs
-Xms40m
-Xmx1024m
-XX:MaxPermSize=256m
I hope this helps out someone in the same situation. This problem was happening when I'd launch my Xtext plugin.
我希望这可以帮助处于相同情况的人。当我启动我的 Xtext 插件时发生了这个问题。
回答by Sebastian Zarnekow
Please add following to the vm parameters in the launch configuration (Run -> Run Configurations)
请在启动配置中的 vm 参数中添加以下内容(运行 -> 运行配置)
-XX:MaxPermSize=128m
That should help.
那应该有帮助。
回答by vineets
I'm using Eclipse Helios build - 1415 (64 Bit). Adding it to the run configurations above didn't work for me. I had to go in and add it to the eclipse.ini file. Just appended it towards the end of the file and restarted eclipse and it works.
我正在使用 Eclipse Helios 版本 - 1415(64 位)。将它添加到上面的运行配置对我不起作用。我不得不进入并将其添加到 eclipse.ini 文件中。只是将它附加到文件的末尾并重新启动 eclipse 并且它可以工作。