标签:设置 runtime less base roc top jre 打开文件 lis
linux下tomcat的运行文件为catalina.sh,打开文件,在文件靠近顶部找到“ JAVA_OPTS ”字样,在它后面添加如下内容即可
# JAVA_OPTS (Optional) Java runtime options used when any command # is executed. # Include here and not in CATALINA_OPTS all options, that # should be used by Tomcat and also by the stop process, # the version command etc. # Most options should go into CATALINA_OPTS. # JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms700m -Xmx1024m -XX:NewSize=512m -XX:MaxNewSize=1024m -XX:PermSize=512m -XX:MaxPermSize=512m" # JAVA_ENDORSED_DIRS (Optional) Lists of of colon separated directories # containing some jars in order to allow replacement of APIs # created outside of the JCP (i.e. DOM and SAX from W3C). # It can also be used to update the XML parser implementation. # Defaults to $CATALINA_HOME/endorsed.
windows下tomcat的运行文件为catalina.bat,打开文件,在文件中部找到“rem ----- Execute The Requested Command -----”字样 ,在它后面添加如下内容即可
set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%" rem ----- Execute The Requested Command --------------------------------------- set JAVA_OPTS=%JAVA_OPTS% -server -Xms2048m -Xmx2048m -Xmn512m -XX:PermSize=400m -XX:MaxPermSize=700m echo Using CATALINA_BASE: "%CATALINA_BASE%" echo Using CATALINA_HOME2: "%CATALINA_HOME2%" echo Using CATALINA_TMPDIR: "%CATALINA_TMPDIR%" if ""%1"" == ""debug"" goto use_jdk echo Using JRE_HOME: "%JRE_HOME%" goto java_dir_displayed :use_jdk echo Using JAVA_HOME: "%JAVA_HOME%" :java_dir_displayed echo Using CLASSPATH: "%CLASSPATH%"
需要注意的是上面各值的大小需要根据服务器本身的内存大小来设置
标签:设置 runtime less base roc top jre 打开文件 lis
原文地址:https://www.cnblogs.com/hanmk/p/9324381.html