Thursday, November 20, 2008

Additional Steps if encountering frequent “java.lang.OutOfMemoryError: PermGen space” exception.

Glassbox does take up some additional memory slowing the startup. Also, it tends to place additional load in the PermGen (Permanent Generation) memory space - this would result in the Server crashing out with "java.lang.OutOfMemoryError: PermGen space" exception (see http://blogs.sun.com/fkieviet/entry/classloader_leaks_the_dreaded_java for details).

The fix is a simple matter of increasing your max PermGen size (default is 64MB in Sun Servers). Use the following options when starting the JVM:
-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled
-XX:MaxPermSize=128m

This actually works for any genuine PermGen error. But note that in most cases, PermGen running out of space is because of inefficient or incorrect cleaning up for Garbage collection - that is, some where in your code, you are unnecessarily keeping references even after use.

2 comments:

  1. Hi Team

    I want to know means of "Calls per Operation" used in glass box test result.

    ReplyDelete
  2. Hi Reigh

    I didnt come across "Calls per Operation" in the Glassbox 2.0 web app, the JMX details nor in the properties. Do post the exact context or a link to a screenshot...

    But I can take a guess it means the number of times a method within an operation gets called during the period of that operation.

    ReplyDelete

 
Superblog Directory