Published on Feb 15 2012 in Java

You can tune MaxPermSize/PermSize parameters and set it above the default value e.g. add -XX:MaxPermSize=96m to JAVA_OPTS variable in ~/appservers/apache-tomcat/conf/catalina.sh file (~/appservers/jboss/bin/run.sh in case of JBoss). PermSize is addition to the heap so the total reserved memory will increase.

Alternatively you may try to stay within your package heap limit when increasing the paramter value so that Xmx + MaxPermSize - default PermSize <= your package limit. Restart your application server for the change to take effect.

Note JDK 8 removed PermGen space and introduced MetaSpace that is no longer using Heap but native memory to store class metadata. New startup parameter that can be used to limit usage of native memory is MaxMetaspaceSize. Tu upgrade MetaSpace you will need to upgrade package (as MetaSpace is relative to Heap limit) or contact support.

See also http://www.freshblurbs.com/blog/2005/05/19/explaining-java-lang-outofmemoryerror-permgen-space.html and http://www.brokenbuild.com/blog/2006/08/04/java-jvm-gc-permgen-and-memory-options/ for more details on the error and inspect ~/appservers/apache-tomcat/logs/catalina.out (or similar log for your application servers) for possible error messages.