Tomcat itself cannot run directly on the computer, and relies on a hardware-based operating system and a Java virtual machine. When the Java program starts, the JVM allocates an initial memory and maximum memory to the application. This initial memory and maximum internal presence will affect the performance of the program. For example, when the application uses the maximum memory, the JVM is going to do the garbage collection action, releasing some memory occupied. So when you want to adjust the initial and maximum memory for Tomcat startup, you need to declare to the JVM that normal Java programs can adjust the application's initial and maximum memory by-XMS-XMX in. Setting JVM Parameters
Under Windows, under $tomcat_home/bin/catalina.bat,linux, in front of $tomcat_home/bin/catalina.sh, add the following settings:
java_opts= "-xms [min heap Size]-xmx[max heap Size]"
For example:
Java_opts= "-xms1024m-xmx1024m-xx:permsize=128m-xx:maxpermsize=256m"
The specific JVM parameter values need to be configured & optimized according to the Web application, which is not covered here.