java-jar 参数
管理平台 : (2核4G)
CMS收集器
nohup java -jar -XX:MaxMetaspaceSize=256M -XX:MetaspaceSize=256M -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:+CMSClassUnloadingEnabled -XX:+ParallelRefProcEnabled -XX:+CMSScavengeBeforeRemark -XX:ErrorFile=/export/log/APP_NAME/hs_err_pid%p.log -Xloggc:/export/log/APP_NAME/gcc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M -XX:HeapDumpPath=/export/log/APP_NAME -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintCommandLineFlags $APP_NAME --spring.profiles.active=prod > /dev/null 2>&1 &
非管理平台(2核4G)
CMS收集器
nohup java -jar -Xmx2048M -Xms2048M -XX:MaxMetaspaceSize=512M -XX:MetaspaceSize=512M -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:+CMSClassUnloadingEnabled -XX:+ParallelRefProcEnabled -XX:+CMSScavengeBeforeRemark -XX:ErrorFile=/export/log/APP_NAME/hs_err_pid%p.log -Xloggc:/export/log/APP_NAME/gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M -XX:HeapDumpPath=/export/log/APP_NAME -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintCommandLineFlags $APP_NAME --spring.profiles.active=prod > /dev/null 2>&1 &
非管理平台 (4核8G)
G1收集器
nohup java -jar -Xmx5120M -Xms5120M -XX:MaxMetaspaceSize=512M -XX:MetaspaceSize=512M -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+ParallelRefProcEnabled -XX:ErrorFile=/export/logs/hs_err_pid%p.log -Xloggc:/export/logs/gc-%t.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M -XX:HeapDumpPath=/export/logs/ -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+HeapDumpOnOutOfMemoryError -XX:+PrintCommandLineFlags $APP_NAME --spring.profiles.active=prod > /dev/null 2>&1 &
本文地址:https://blog.csdn.net/qq_17522211/article/details/107315794