Eclipse throwing PermGen Space errors
My Eclipse helios has been throwing weird PermGen space
and Java Heap
errors since the time I've got this new HDD, put new OS into it and have re-installed Java.
Does anyone have a guess w开发者_如何学运维hy this is happening?
I followed this, this and this as well but adding anything into eclipse.ini
just won't work. The only way I could get it to work was to start eclipse from command line with specific parameters.
I am running on windows 7 as of now.
here's my eclipse.ini
I've added some things into it after going through the above links:
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vm
C:/Program Files/Java/jre6/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512m
-Xmx1024m
-XX:+UseParallelGC
-XX:PermSize=512M
-XX:MaxPermSize=512M
EDIT
Here are the screenshots of the errors that I am receiving, even after correcting the ini file:
And here it finally asks if I would like to exit the workbench. If I choose not to, then nothing works.
Sorry for flooding this question with images, but I felt they'll help.
You have two -vmargs. You should only have one, combining the two fields. Ie:
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512m
-Xmx1024m
-XX:+UseParallelGC
-XX:PermSize=512M
-XX:MaxPermSize=512M
The extra -vmargs
will be passed from the launcher to the JRE and so it's fairly platform dependent as to what happens. On my Apple/Sun JRE with Eclipse 3.7, it's ignored. On my Sun JRE with Eclipse 3.7 on Windows, it errors immediately. It's possible that there's a setup that ignores everything after the invalid parameter.
The screenshots are not very useful. They all just complain about permgen and head space in different ways. Here's my eclipse.ini
(Windows 7 64-bit, 32-bit Java, JDK 1.7.0):
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms40m
-Xmx384m
Have you checked the actual Eclipse command line? Open the task manager and make sure that you have "Command Line" selected in "Select columns". My command line looks something like this:
"C:\Program Files (x86)\Java\jdk1.7.0\bin\javaw.exe" ... -Xms40m -Xmx384m ... -Xmx1024m -XX:MaxPermSize=256m ...
If the options are not present, then you (unsurprisingly) have a problem with the Eclipse launcher. If the options are in place and you still get the permgen/heap space problems, then you probably have a memory leak of some sort. Your best shot is to use a tool like JVisualVM to figure out where the problem lies.
Not all problems with heap and permgen space are caused by too small limits being passed to the JVM.
No changes in ini file had helped me. JesperE's variant won't worked. But you could set variables in VM arguments as here
精彩评论