From 817fdda3339ee48e9f1c995ee6e8c49f88d73608 Mon Sep 17 00:00:00 2001 From: Kerrigan Date: Sun, 12 Feb 2017 17:13:57 +0800 Subject: [PATCH] Update runbroker.sh when use g1 grabage, needen't set xmn,because it's cause full gc ! http://www.oracle.com/technetwork/articles/java/g1gc-1984535.html Young Generation Size: Avoid explicitly setting young generation size with the -Xmn option or any or other related option such as -XX:NewRatio. Fixing the size of the young generation overrides the target pause-time goal. --- bin/runbroker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/runbroker.sh b/bin/runbroker.sh index 3405d3926ce..f779f80743b 100755 --- a/bin/runbroker.sh +++ b/bin/runbroker.sh @@ -36,7 +36,7 @@ export CLASSPATH=.:${BASE_DIR}/conf:${CLASSPATH} #=========================================================================================== # JVM Configuration #=========================================================================================== -JAVA_OPT="${JAVA_OPT} -server -Xms8g -Xmx8g -Xmn4g" +JAVA_OPT="${JAVA_OPT} -server -Xms8g -Xmx8g" JAVA_OPT="${JAVA_OPT} -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=30 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:SurvivorRatio=8 -XX:+DisableExplicitGC" JAVA_OPT="${JAVA_OPT} -verbose:gc -Xloggc:/dev/shm/mq_gc_%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy" JAVA_OPT="${JAVA_OPT} -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=30m"