tomcat memory modification summary

Before the explanation, let’s talk about how to check whether the memory has been modified successfully
1. Check the process ID. After tomcat runs, both Linux and Windows have process IDs (the process ID is displayed under Windows: Open Task Manager --> View --> Select PID) ;
2. Run jmap under jdk/bin -heap [tomcat's process number]

The meaning of the parameter -vmargs:
the following is the VM parameter
-Xms40m: the virtual machine occupies the minimum memory of the system
-Xmx256m: the virtual machine occupies the maximum memory of the system
-XX:PermSize: Minimum stack memory size. Generally, when the memory is insufficient, it is said that this is too small, and the remaining heap space is less than 5%, and a warning will be issued. It is recommended to set this slightly larger, but you must set
-XX:MaxPermSize: the maximum stack memory size according to the memory size of your machine. This is also appropriately larger
- 5% of -Xmx512M is 25.6M. In theory, the value of -Xmx and -XX:MaxPermSize must be greater than 25.6M.


Here is an explanation of the memory modification methods in three usage scenarios of tomcat: 1. Edit catalina in
tomcat under linux .
sh #Configure
heap memory size
JAVA_OPTS="-server -Xms2048m -Xmx2048m" #Configure
non-heap memory size
JAVA_OPTS="$JAVA_OPTS -XX:PermSize=512m -XX:MaxPermSize=1024m" #Configure
the memory size of each thread in the heap
JAVA_OPTS="$JAVA_OPTS -Xss512k"

2. Eclipse refers to the tomcat decompression file.
In the Eclipse menu bar, Window ——>Preferences ——>Server ——>Runtime Environment; select the Tomcat you use and click Edit... to pop up Edit Server Runtime Ecvironment under the JRE option. Installed JREs... Click to pop up Installed JREs; select the Tomcat you are using and click Edit.. Fill in -Xms256m -Xmx512m in Defaul VM Atguments:


3. Maven's tomcat plug-
in Select the Environment tab in the eclipse tomcat run configuration interface, Add parameter:
MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"






Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326993254&siteId=291194637