Configuring the Java Permanent Generation (Permgen)

The ‘Permgen’ command refers to the location in memory where the JVM stores the class files that have been loaded into memory.  This is different and distinct from the heap, which is where the JVM stores the object instances used by an application.

Figure 11 - Setting the permgen using -XX:PermSize and -XX:MaxPermSize

Permgen can be configured using –XX:PermSize & -XX:MaxPermSize parameters as shown in figure 10.

It is recommended that the initial and maximum values for the size of the permanent generation be set to the same value. This will instruct the JVM to create the permanent generation so that it is initially at its maximum size and prevent possible full garbage collections from occurring as the permanent generation expands to its maximum size.

On a default install of Tomcat, this setting is 64m and for most deployments this is not sufficient.  In our ‘typical deployment’ with a scenario where around 200 concurrent users are hitting Dekho, a good starting point is to increase the setting to 256m.



For more details on configuring these values, please refer to a post on our Dekho Resource Center.