You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2018/09/03 12:01:28 UTC

[GitHub] dongeforever commented on a change in pull request #449: [ISSUE #436] set JVM options according to JDK version

dongeforever commented on a change in pull request #449: [ISSUE #436] set JVM options according to JDK version
URL: https://github.com/apache/rocketmq/pull/449#discussion_r214666196
 
 

 ##########
 File path: distribution/bin/runserver.sh
 ##########
 @@ -36,8 +36,14 @@ export CLASSPATH=.:${BASE_DIR}/conf:${CLASSPATH}
 #===========================================================================================
 # JVM Configuration
 #===========================================================================================
+version=$("$JAVA" -version 2>&1 | awk -F '"' '/version/ {print $2}')
+if [[ "$version" > "1.7" ]]; then
+  JAVA_OPT="${JAVA_OPT}"
+else
+  JAVA_OPT="${JAVA_OPT} -XX:-UseParNewGC -XX:+UseCMSCompactAtFullCollection"
+fi
 JAVA_OPT="${JAVA_OPT} -server -Xms4g -Xmx4g -Xmn2g -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=320m"
-JAVA_OPT="${JAVA_OPT} -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8  -XX:-UseParNewGC"
+JAVA_OPT="${JAVA_OPT} -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8"
 
 Review comment:
   why remove -UseParNewGC and + UseCMSCompactAtFullCollection

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services