Feb 15

Eclipse PermGen Memory Leak

Since updating to eclipse 3.3 in my new Arch linux system I’ve been having trouble with the respected programming IDE. It crashes. Real bad. Frequently. Surfing the web a bit, I have become aware that I am not alone. Many more are reporting the same bug and apparently no one has come with a permanent solution. When eclipse crashes, it writes the following to the .metadata log:

!ENTRY org.eclipse.osgi 4 0 2008-02-15 09:37:14.597
!MESSAGE Shutdown error
!STACK 1
java.lang.OutOfMemoryError: PermGen space
!SESSION Fri Feb 15 09:37:15 CST 2008 ------------------------------------------
!ENTRY org.eclipse.equinox.launcher 4 0 2008-02-15 09:37:15.314
!MESSAGE Exception launching the Eclipse Platform:
!STACK
java.lang.OutOfMemoryError: PermGen space

A memory leak in PermGen space. What’s that? Well, PermGen is short for permanent generation heap space. It is the space where all things that live forever and are not to be garbage-collected reside. These include classes and interned Strings (a better explanation of these entities can be found here). So what’s the deal? Is eclipse loading up to many classes then? Maybe we need more space for our String constants? A temporary solution to these recurrent crashes is to increase our PermGen space (it has 64M size by default) by starting eclipse with the following argument:
-vmargs -Xmx512M -XX:PermSize=64M -XX:MaxPermSize=128M
That gives us 128 megs of Perm space, which ought to ok for almost anything. However, some people are reporting the same error even within a 512M max perm size limit (see the bug report link above). Is this a VM problem? An eclipse problem (which is known for its tendency to hogging memory)? WTF?
I just hope that it is soon fixed and that the temporary solution works (at least temporarily =P).

No comments

No Comments

Leave a comment

You must be logged in to post a comment.