Tomcat Memory Settings
search cancel

Tomcat Memory Settings


Article ID: 88581


Updated On:


CA Automic Workload Automation - Automation Engine



OutOfMemoryErrors in Tomcat


The default memory settings of Tomcat are usually very low, especially regarding the PermGenSpace.



Release: AUTOME99000-2.0-Automic-Oracle Retail MOM-Enterprise Edition


Please set the Maximum PermGenSpace to at least 256mb and the maximum heap space to the maximum you can expect to fit into physical memory. How to do this varies depending on where and how you install Tomcat (e.g. environment variables on Unix, tomcat7w.exe when using the Windows installer), so please consult the documentation applicable for your installation before applying the settings described here.

Running Tomcat as a Windows service:
In this scenario, please open tomcat7w.exe, the configuration tool for tomcat, switch to the Java tab, and 

  1. add "-XX:MaxPermSize=256m" (without the qoutes) as a separate line
  2. set the "Maximum memory pool" setting to a value that will fit into your physical memory.

as shown in the following screenshot (here we assume that we can fit 8192mb into main memory).


<Please see attached file for image>

align="bottom" class="documentation" border="0" alt=".png" src="">

When using Tomcat on Windows (but not as a service) or on a Linux system
In this scenario, the startup scripts of Tomcat will pass the values in the CATALINA_OPTS environment variable to the JVM. To apply the same settings from the previous example, you would set the value to "-Xmx8192m -XX:MaxPermSize=256m" (without the quotes).

Note: With a 32 bit JVM, the maximum possible heap space is severely restricted. We recommend a 64bit JVM to be able to use all available RAM if necessary.