Friday, August 28, 2009

The Perm Gen Exception in JBoss

We sometimes get the PermGen runtime exception thrown from JBoss when running our app. Following in the lines of the exception i stumbled upon two very useful articles explaining the same. This can be found at;

http://www.unixville.com/~moazam/stories/2004/05/17/maxpermsizeAndHowItRelatesToTheOverallHeap.html
http://narencoolgeek.blogspot.com/2007/08/heap-size-and-perm-size.html

As it states Permanent Generation space is different from the Heap space we set using th -Xms commands as Perm Gen space is used to store class objects / method objects generated using reflection. As we use Hibernate this space is definitely growing with time and as the first post above says we should set the -XX:PermSize and -XX:MaxPermSize when running our app servers in order to minimize the risk of these exceptions occurring. You can also set the -XX:+HeapDumpOnOutOfMemoryError option to tell the VM to generate a heap dump if OutOfMemoryError is thrown.


No comments:

Post a Comment