How to increase the memory of a Tomcat Server

In Windows, it’s quite easy to increase the memory by using the Tomcat Monitoring Application tomcat9w. You find the application in the following directory:

%CATALINA_HOME%\bin\tomcat9w.exe

A small dialog will open and you need to select the Java tab in the top. To increase the memory you need to change the value in the Maximum memory pool property. In the screenshot you can see, that I have changed the value to 4GB.

Select the Java Tab and change the Maximum memory pool property to increase the memory

Increase the memory with additional options

Another way to increase memory is to create a setenv.sh for unix or setenv.bat for windows system in the %CATALINA_HOME%/bin folder.

# initial memory allocation
export CATALINA_OPTS="$CATALINA_OPTS -Xms512m"
# maximum memory allocation
export CATALINA_OPTS="$CATALINA_OPTS -Xmx8192m"

Check configuration

If you want to double check the configuration, you can use the jinfo command line tool from the running process. You need to go to the following directory and give the process id.

// Check settings 
%JAVA_HOME%\bin\jinfo -flags PID
chevron_left
chevron_right

Join the conversation

comment 1 comment
  • Tom

    Hi
    Great article. That was what I’m looking for.

Leave a comment

Your email address will not be published. Required fields are marked *

Comment
Name
Email
Website

This site uses Akismet to reduce spam. Learn how your comment data is processed.