Add Tomcat to use memory

xiaoxiao2021-03-06  108

Everyone knows that the JVM will allocate an initial memory and maximum memory to this application when the Java program starts. This initial memory and maximum internal existence will affect the performance of the program. For example, when the application uses the maximum memory, JVM is to go to the action of garbage recycling, and release some memory is occupied. So when you want to adjust the startup of Tomcat, initial memory and maximum memory need to be declared to the JVM. The general Java program can adjust the initial memory and maximum memory of the application through medium -XMS -XMX: Java -XMS64M -XMX128M A.jar.tomcat's launcher is packaged, and Java -x ..... Tomcat. * can not be used directly to change the settings of the memory. There are two ways to change this setting in Tomcat: 1. You need to add Tomcat_OPTS, Catalina_OPTS = -XMS64M -XMX512M; MS is the smallest, MX is the largest, 64m, 512m respectively It refers to the amount of memory .2. Catalina.bat modified file 166 OK "rem Execute Java with the applicable properties" row each of the following% _EXECJAVA%% JAVA_OPTS%% CATALINA_OPTS%% DEBUG_OPTS% -Djava.endorsed.dirs = "% JAVA_ENDORSED_DIRS % "-classpath"% classpath% "-dcatalina.base ="% catalina_base% "-dcatalina.home ="% CATALINA_HOME% "-djava.io.tmpdir ="% catalina_tmpdir% "% mainclass%% cmd_line_args% Action% % CATALINA_OPTS% replacement into -XMS64M -XMX512M

转载请注明原文地址:https://www.9cbs.com/read-102775.html

New Post(0)