jvm配置示例

 

java \
    -XX:+UseG1GC \
    -XX:MaxGCPauseMillis=100 \
    -XX:InitiatingHeapOccupancyPercent=45 \
    -XX:G1HeapRegionSize=16m \
    -XX:+ParallelRefProcEnabled \
    -XX:MaxTenuringThreshold=3 \
    -XX:+AlwaysPreTouch \
    -Xmx4096M \
    -Xms4096M \
    -Xmn2048M \
    -XX:MaxMetaspaceSize=256M \
    -XX:MetaspaceSize=256M \
    -XX:MaxDirectMemorySize=100M \
    -XX:ReservedCodeCacheSize=268435456 \
    -XX:-OmitStackTraceInFastThrow \
    -Djava.security.egd=file:/dev/./urandom \
    -verbose:gc \
    -XX:+PrintGCDetails \
    -XX:+PrintGCDateStamps \
    -XX:+PrintGCApplicationStoppedTime \
    -XX:+PrintGCApplicationConcurrentTime  \
    -XX:+PrintTenuringDistribution \
    -XX:+PrintClassHistogramBeforeFullGC \
    -XX:+PrintClassHistogramAfterFullGC \
    -Xloggc:/tmp/logs/gc_%p.log \
    -XX:+HeapDumpOnOutOfMemoryError \
    -XX:HeapDumpPath=/tmp/logs \
    -XX:ErrorFile=/tmp/logs/hs_error_pid%p.log \
    -Djava.rmi.server.hostname=127.0.0.1 \
    -Dcom.sun.management.jmxremote \
    -Dcom.sun.management.jmxremote.port=14000 \
    -Dcom.sun.management.jmxremote.ssl=false \
    -Dcom.sun.management.jmxremote.authenticate=false \
    -javaagent:/opt/test.jar \
    MainRun

 

posted @ 2021-08-19 11:01  mzjnumber1  阅读(66)  评论(0编辑  收藏  举报