Monday, October 15, 2007

Does your Eclipse 3.3.1 crash frequently? Here is help.



Are you running Eclipse 3.3.1 on Windows using a Sun JVM? Does it crash frequently? Then you are probably affected by a combination of a low PermGen size on Sun VMs (64mb by default) and Bug #203325. Read on for instructions on how to mitigate this.


Update 7/19/2010: Eclipse (any version) and Java 6u21 has a similar problem causing frequent crashes. Be sure to change the eclipse.ini to use -XX:MaxPermSize=256m

Wait what is PermGen anyway?

PermGen stands for permanent generation and is the memory used to hold "data needed by the virtual machine to describe objects that do not have an equivalence at the Java language level. For example objects describing classes and methods are stored in the permanent generation" (related article). As it turns out the default size of 64m on Sun VMs is rather low for large apps like Eclipse. I tend to hit that barrier within 30 minutes. Normally the Eclipse command line arguments set the size to 256m, but Bug #203325 in Eclipse 3.3.1 prevents this. I was hit by this right after I upgraded to 3.3.1 this week. Fortunately, I was aware of the issue thanks to a discussion about OutOfMemory Errors at EclipseZone.

Here is what you can do:
  1. Edit your eclipse.ini to replace the --launcher.XXMaxPermSize 256m entries with the a working equivalent. Remember: on Windows with Sun VMs only. If you are using larger software stacks (i.e. Webtools) you may even want to increase the size beyond 256m. The FAQ entry "How do I increase the PermGen size available to Eclipse" has the background information.

    Modified eclipse.iniOriginal eclipse.ini
    -showsplash org.eclipse.platform
    -vmargs

    -XX:MaxPermSize=256m

    -Xms40m
    -Xmx256m
    -showsplash org.eclipse.platform --launcher.XXMaxPermSize
    256m

    -vmargs
    -Xms40m

    -Xmx256m


  2. Visit Bug #203325 to keep up with current developments. The issue has been fixed for the 3.3.2 service release, but there is a discussion going on about ways to make this fix available earlier.

Related Articles

Monday, October 8, 2007

RAP Talk at the Portland Java User Group (Oct 16th)

Are you curious about the Eclipse Rich Ajax Platform and based in Oregon / Washington? Then consider attending my talk "Java-based web-apps with the Eclipse Rich Ajax Platform" at the Portland Java User Group (free of charge, sponsored pizza).

During the talk I will:

  • introduce RAP to an audience of Java Developers (no Eclipse knowledge assumed)
  • explain key concepts
  • point-out noteworthy features
  • demonstrate the complete cycle of creating a small RAP application
The talk is scheduled for Tue, Oct 16th, at 6:30 PM at the Oracle Downtown Campus. Directions and more info...

See you there,
Elias.

 

Content: © Copyright 2007 - 2009, Elias Volanakis. All rights reserved. Datenschutzhinweis / Privacy Policy