How much memory is "good enough" memory ?
Eclipse crashes within 20 minutes of usage with this stacktrace. Wonder how much memory is good enough ? I’ve put a max heap size of 1G, which seems to be insufficient.
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:161)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:501)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:471)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:430)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:413)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:408)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at org.eclipse.ui.internal.progress.ProgressManager$1.done(ProgressManager.java:447)
at org.eclipse.core.internal.jobs.JobListeners$3.notify(JobListeners.java:39)
at org.eclipse.core.internal.jobs.JobListeners.doNotify(JobListeners.java:96)
at org.eclipse.core.internal.jobs.JobListeners.done(JobListeners.java:152)
at org.eclipse.core.internal.jobs.JobManager.endJob(JobManager.java:550)
at org.eclipse.core.internal.jobs.WorkerPool.endJob(WorkerPool.java:105)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:71)
Error while logging event loop exception:
java.lang.OutOfMemoryError: PermGen space
How large is your workspace? I’ve seen this issue with gigantic workspaces.
Chris Aniszczyk
15 Aug 07 at 8:18 pm
It’s not the heap space that’s the problem. It the MaxPermSize.
Add -XX:MaxPermSize=128M to your eclipse.ini file.
Here’s what mine looks like (Eclipse 3.3):
-showsplash
org.eclipse.platform
-vmargs
-Xms40m
-Xmx768m
-XX:MaxPermSize=128M
FYI, http://www.eclipsezone.com/eclipse/forums/t61618.html
HTH,
Wayne
Wayne Beaton
15 Aug 07 at 8:22 pm
I do not remember having this problem before. And shouldn’t that be in eclipse.ini ?
I know for sure that IntelliJ does this.
Ketan
15 Aug 07 at 8:50 pm
Chris,
My workspace has just one tiny project in it.
Ketan
15 Aug 07 at 8:55 pm
I had this problem with Eclispe 3.3. Didn’t have it with Eclipse 3.2 (I kept a concurrent install).
I tried all sorts of JVM option incantations: adjusting heap size, adjusting permgen min/max, so on and so forth. I even got on the #eclipse IRC channel and posted my problem, no luck.
This was on a fresh Eclipse 3.3 install with a brand-new workspace (no projects or plugins).
I never got it to work.
On the other hand, I installed MyEclipse 6.0.0 M1 (based on Eclipse 3.3; I have a MyEclispe subscription) and it worked fine. No crashing. To this day I can’t use Eclipse 3.3, but I can use MyEclipse 6.0.0 M1. Go figure.
Moral of the story: Ketan, you might want to try some of the 3rd party distros of Eclipse 3.3:
http://www.eclipse.org/downloads/distros.php
Hopefully one of those will work for you.
Kyle Adams
15 Aug 07 at 9:24 pm
It’s not the size of the workspace, it’s the size of the install: more plugins = more permgen required (as others have mentioned). For reference: http://wiki.eclipse.org/IRC_FAQ#I.27m_having_memory.2C_heap.2C_or_permgen_problems.2C_what_can_I_do.3F
Nick Boldt
16 Aug 07 at 12:02 am
https://bugs.eclipse.org/bugs/show_bug.cgi?id=200084
Nick Boldt
16 Aug 07 at 12:27 am
FYI, the Sun JVM splits the heap into different spaces. The PermGen space is where classes are kept – its size is fixed when the JVM starts and can sometimes overflow when an application uses a lot of classloaders / proxies, or does a lot of code generation.
Other non-HotSpot based JVMs, like those from BEA and IBM do not suffer from this particular problem.
Stuart
16 Aug 07 at 3:20 am
You could also try JRockit which has no PermGen and uses the Heap for classloading…
Markus
16 Aug 07 at 3:41 am
It’s not the size of the workspace that causes this problem, it’s the number of classes. Assuming you have a lot of plug-ins (having just web tools added can have this effect), you have a lot of classes which cause the default setting to fail miserably)
Wayne Beaton
16 Aug 07 at 4:18 am
I do not really have too many plugins either. It’s just the plain eclipse SDK+mylyn+subclipse.
Ketan
16 Aug 07 at 10:39 am