java.lang.OutOfMemoryError: PermGen space

This error message occurs when memory reserved for permanent generation of garbage collectors (GC) runs out. Other GC generations are: young generation -> tenured generation -> permanent generation.

You can set the permanent generation memory pool:

-XX:PermSize=64m
-XX:MaxPermSize=256m

In contrast to setting heap memories:

-Xms768m 
-Xmx1024m

For java service wrapper, add to wrapper.conf

wrapper.java.additional.2=-XX:PermSize=64
wrapper.java.additional.3=-XX:MaxPermSize=256

Some of the default values for Sun JVMs are listed below.

JDK 1.3.1_06

Initial Size

Maximum Size

Client JVM

1MB

32MB

Server JVM

1MB

64MB

     

JDK 1.4.1_01

Initial Size

Maximum Size

Client JVM

4MB

64MB

Server JVM

4MB

64MB

     

JDK 1.4.2

Initial Size

Maximum Size

Client JVM

4MB

64MB

Server JVM

16MB

64MB

     

JDK 1.5.0

Initial Size

Maximum Size

Client JVM

8MB

64MB

Server JVM

16MB

64MB

This entry was posted in java. Bookmark the permalink.