Knowledgebase article 3

Allocate more RAM to Tomcat (For "PermGen" or "Java Heap Space" errors)


This article contains information about how to set up the JAVA_OPTS variables to increase the memory available for Tomcat to use. These variables do not always have to be set, but by setting them correctly, it may resolve many reporting issues and errors.

This generally fixes error keywords: “PermGen” or “JavaHeap"


For additional instructions (that usually contain images), see the attached document.

For v11 and newer, edit the file wrapper.conf located in tomcat/conf directory.  Modify the following java parameter:

-XX:PermSize=1024m
-XX:MaxPermSize=1024m

Increase the Initial Java Heap Size and Maximum Java Heap Size.  Usually 512M will work, but you can increase to 1024M.


Follow instructions below for v10 and older
Windows:

1. Run (as administrator) the "Configure Tomcat" application.  (GLtomcat6w.exe located in the tomcat directory root\bin\).

2. Click on the Java tab.

3. Under Java Options, add the following lines (to the bottom of possibly many already existing lines):

-XX:PermSize=512m
-XX:MaxPermSize=512m

Note: These are case sensitive and be very careful not to include any additional spaces.  You may also wish to try 1024m in these values.

4. Click the "general" tab and restart the tomcat service by clicking the command buttons under "Service Status."

5. Click OK to close the application.

Linux:

1. Find and edit the catalina.sh file.  (usually located in /usr/share/tomcat6/bin).

2. Inside catalina.sh, find the JAVA_OPTS variable (usually at the bottom of the comments section).

3. Edit the JAVA_OPTS variable to be:

JAVA_OPTS='-Xms128m -Xmx512m -XX:PermSize=128m -XX:MaxPermSize=512m -Djava.awt.headless=true'

Note: This is case sensitive and be very careful not to include any additional spaces.

4. Exit the editor and restart the tomcat service.


Email

To

  • eHD Standard Support
  • Nov 16, 2016
  • Public
  • 4142