Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tomcat is especially memory hungry, and will benefit from being given lots of RAM. To set the amount of memory available to Tomcat, use either the JAVA_OPTS or CATALINA_OPTS environment variable, e.g:

Code Block
    JAVACATALINA_OPTS=-Xmx512m -Xms512m

OR

Code Block
    CATALINAJAVA_OPTS=-Xmx512m -Xms512m

The above example sets the maximum Java Heap memory to 512MB.

Info
titleDifference between JAVA_OPTS and CATALINA_OPTS

You can use either environment variable. JAVA_OPTS is also used by other Java programs (besides just Tomcat). CATALINA_OPTS is only used by Tomcat. So, if you only want to tweak the memory available to Tomcat, it is recommended that you use CATALINA_OPTS. If you set both CATALINA_OPTS and JAVA_OPTS, Tomcat will default to using the settings in CATALINA_OPTS.

...

To increase the amount of PermGen memory available to Tomcat (default=64MB), use either the JAVA_OPTS or CATALINA_OPTS environment variable, e.g:

Code Block
    JAVACATALINA_OPTS=-XX:MaxPermSize=128m

OR

Code Block
    CATALINAJAVA_OPTS=-XX:MaxPermSize=128m

...