[推荐]JVM参数统一管理
//根据实际内存计算,使用实际内存的50%, 默认为2g //$app 应用名 -Xmx{$xmx}g -Xms{$xmx}g -Xss256k -XX:NewRatio=1 -XX:SurvivorRatio=8 -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=512m -XX:MaxTenuringThreshold=5 -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Djdk.tls.ephemeralDHKeySize=2048 -XX:+ExplicitGCInvokesConcurrent -Djava.security.egd=file:/dev/./urandom -Dsun.net.inetaddr.ttl=30 -XX:+PrintGCDetails -verbose:gc -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintTenuringDistribution -XX:+PrintPromotionFailure -XX:+PrintGCApplicationStoppedTime -XX:+PrintHeapAtGC -Xloggc:/data/$app/logs/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/$app/logs/ -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M -XX:ErrorFile=/data/$app/logs/hs_err_%p.log 示例模板: -Xmx2g -Xms2g -Xss256k -XX:NewRatio=1 -XX:SurvivorRatio=8 -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=512m -XX:MaxTenuringThreshold=5 -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Djdk.tls.ephemeralDHKeySize=2048 -XX:+ExplicitGCInvokesConcurrent -Djava.security.egd=file:/dev/./urandom -Dsun.net.inetaddr.ttl=30 -XX:+PrintGCDetails -verbose:gc -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintTenuringDistribution -XX:+PrintPromotionFailure -XX:+PrintGCApplicationStoppedTime -XX:+PrintHeapAtGC -Xloggc:/data/calprovider/logs/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/calprovider/logs/ -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=10M -XX:ErrorFile=/data/calprovider/logs/hs_err_%p.log