Knowledgebase: VPS Hosting Plans
Facing an exception - java.lang.OutOfMemoryError: PermGen space. How do I increase my JVM MaxPermSize?
Posted by - NA - on 01 April 2009 05:55 AM

The "OutOfMemoryError: PermGen space" message is normally encountered during development activities where a long-running JVM is asked to load/unload builds. However, it can also be encountered in a recently spawned JVM under the "right" set of conditions. The message is a symptom of an incomplete garbage collection sweep where resources are not properly released upon unload/restart. By default PermGen size is set to 128MB, but you can increase this value. You need to access the following file on the server:


uncomment and modify JSVC_OPTS value by adding -XX:MaxPermSize parameter there, so it should be something like this:

JSVC_OPTS="-Djava.awt.headless=true -XX:MaxPermSize=128m"

More info about how big should PermGen be and how to prevent this exception in future you can find at Java official documentation regarding garbage collection:

(286 vote(s))
Not helpful

Comments (0)