Thursday, January 10, 2008

Eclipse v3.3.x PermGen Memory Errors

Out-of-the-box Eclipse v3.3.x was giving me on average 12 to 16 crashes per day! I was even seriously considering dropping Eclipse altogether and finding something more stable.

I was using Eclipse v3.3.1 with the WST extension and tigris.org's subclipse v1.2.0 (since the v2.x has serious bugs that prevents it from installing) on a Windows XP Pro platform.

The short of the problems came down to a mistake in the eclipse.ini file that had the
--launcher.XXMaxPermSize
statement come before the
-vmargs
statement. It is a little more involved that that, one issue was that the duel-level launch configuration that Eclipse uses does not always do a great job of detecting Sun VMs, of which the
--launcher.XXMaxPermSize
only works with a Sun VM, which defaults the PermGen space to a size of 64MB.

The suggested fix is to remove
--launcher.XXMaxPermSize
and replace it with
-XX:MaxPermSize=256m
after
-vmargs
it should now pickup the change.

This change and usage of
-XX:MaxPermSize
is said to be universal (to some degree) to other VM's such as the mac.

An example of my config which works, which is "fairly" close to the original eclipse.ini:
-showsplash org.eclipse.platform
-vmargs
-Xms512M
-Xmx1028M
-XX:MaxPermSize=256M

One area of great disappointment with all of this, is that it appears like they were spending a fair amount of time arguing how and when to apply this fix or even announce this potential problem instead of just getting it done. I really do enjoy the Eclipse experience, but because of this problem, I was about to drop it and probably never give it another chance. Good thing I went snooping through their Bugzilla!

References
Eclipse's Bugzilla Entry on this bug

No comments: