java.lang.OutOfMemoryError: PermGen space in Eclipse Helios
Asked Answered
B

2

12

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

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:

-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

======================================================================

Update: I hope this is helpful to anyone who may have the same problem. I followed the instructions here and 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:

-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.

Bulger answered 30/6, 2011 at 15:26 Comment(0)
L
19

Please add following to the vm parameters in the launch configuration (Run -> Run Configurations)

-XX:MaxPermSize=128m

That should help.

Landis answered 2/7, 2011 at 14:8 Comment(1)
what exactly it does when you set argument likeTalipes
G
1

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.

Glorify answered 2/9, 2014 at 23:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.