Tomcat

How To Increase The Java Heap size in Tomcat Application Server

In this guide you will learn how to increase the Java Heap size in Tomcat Application Server

Method 1:

1) Go to <Tomcat Instalation Directory>/bin and create a file named setenv.sh if you are using Linux operating systems or setenv.bat for Windows.

2) Inside the setenv file, use the following parameters to set the heap size:

Linux:

export CATALINA_OPTS=”-Xms4096M -Xmx4096M”

Windows:

set CATALINA_OPTS=-Xms4096M -Xmx4096M

3) Make sure that both the values match for minimum and maximum.

4) Save the file and restart the Tomcat Application Server.

 

Мethod 2:

1 ) Go to Start Menu – >Apache Tomcat 9.0 (You version may vary) – >Configure Tomcat

2) The Apache Tomcat 9.0 Properties Window will apear. 

3) Go to Java tab – > Maximum memory pool

4) Increase the Heap Size, Save the changes and restart Tomcat Application Server.

Important: The memory used will decrease available RAM on the machine. This may lead to performance problems if set too high.

That’s it!

Last Updated on