修改Tomcat的jvm的垃圾回收GC方式
cp $TOMCAT_HOME/bin/catalina.sh $TOMCAT_HOME/bin/catalina.sh.bak_20170815
vi $TOMCAT_HOME/bin/catalina.sh
vi catalina.sh
if [ -z "$JSSE_OPTS" ] ; then
JSSE_OPTS="-Djdk.tls.ephemeralDHKeySize=2048"
fi
JVM_OPTS="-server -verbose:gc
-XX:+PrintGCDateStamps
-XX:+PrintGCDetails
-XX:+UseGCLogFileRotation
-XX:NumberOfGCLogFiles=9
-XX:GCLogFileSize=256m
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled
-XX:CMSInitiatingOccupancyFraction=70
-XX:+CMSClassUnloadingEnabled
-XX:CMSMaxAbortablePrecleanTime=300
-XX:+CMSScavengeBeforeRemark
-XX:GCTimeRatio=19
-XX:SurvivorRatio=3
"
JVM_OPTS="-Xmx16g -Xms4g -Xmn512m $JVM_OPTS -Xloggc:$CATALINA_TMPDIR/jenkins_gc.log"
JAVA_OPTS="$JAVA_OPTS $JVM_OPTS $JSSE_OPTS -Dmail.smtp.starttls.enable=true -Dmail.smtp.auth=true -Dmail.smtp.ssl.trust=mail.service.mtime.com"