JAVA_OPTS 与 CATALINA_OPTS
配置只是该Tomcat使用的环境变量,使用CATALINA_OPTS,而如果配置其他Java应用程序也要使用的环境变量,比如JBoss,在JAVA_OPTS中设置。
tomcat6的说明
rem CATALINA_OPTS (Optional) Java runtime options used when the "start",
rem or "run" command is executed.
rem JAVA_OPTS (Optional) Java runtime options used when the "start",
rem "stop", or "run" command is executed.
tomcat8的说明
rem CATALINA_OPTS (Optional) Java runtime options used when the "start",
rem "run" or "debug" command is executed.
rem Include here and not in JAVA_OPTS all options, that should
rem only be used by Tomcat itself, not by the stop process,
rem the version command etc.
rem Examples are heap size, GC logging, JMX ports etc.
rem JAVA_OPTS (Optional) Java runtime options used when any command
rem is executed.
rem Include here and not in CATALINA_OPTS all options, that
rem should be used by Tomcat and also by the stop process,
rem the version command etc.
rem Most options should go into CATALINA_OPTS.
18001进程是tomcat,只配置CATALINA_OPTS,但是读取到其它tomcat配置的JAVA_OPTS,非必要不适用JAVA_OPTS
image.png普通官网配置
CATALINA_OPTS="-Xms2048m -Xmx2048m -XX:ParallelGCThreads=8 -XX:PermSize=512m -XX:MaxPermSize=1024m -Xloggc:/usr/local/log/gc18001/gc18001.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps"
打印log
-Xloggc:/usr/local/log/gc18001/gc18001.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps
网友评论