I. Increase memory to prevent JVM memory overflow
1. When started as a service
Go to the "Tomcat installation path \ Bin" directory, open the Service.bat file, locate "--jvmoptions", and then add the trailing quotation marks
"-XMS256M;-XMX512M;-XX:PERMSIZE=128M;-XX:MAXPERMSIZE=512M;"
2. When started as a process
Go to the "Tomcat installation path \ Bin" directory, open the Catalina.bat file,
Find the "REM-----Execute The requested Command---------------------------------------",
Add "set java_opts=%java_opts%-server-xms256m-xmx512m-xx:permsize=128m-xx:maxpermsize=512m" below
3. When launched in Eclipse
A. Double-click the Tomcat service under the Servers tab
B. In the Tomcat configuration that opens, click Open Launch Configuration
C. Select the Arguments tab and add it at the end of the box under VM arguments
"-xms256m-xmx512m-xx:permsize=256m-xx:maxpermsize=512m"
Note the preceding space
4. Memory configuration Item Description
-xms256m: Virtual machine occupies the minimum memory of the system
-XMX512M: Virtual machine occupies the maximum memory of the system
-xx:permsize: Minimum stack memory size. Generally reported insufficient memory, are said that this is too small, the remaining heap space is less than 5% will be warned,
It is recommended to set this slightly larger, but depending on the size of your machine's memory
-xx:maxpermsize: Maximum stack memory size. This one's a little bigger.
-xmx512m 5% is 25.6M, theoretically requires-XMX value and-xx:maxpermsize must be greater than 25.6M
Tomcat Common Configuration