runzhiwang commented on a change in pull request #710: HDDS-3173. Provide 
better default JVM options
URL: https://github.com/apache/hadoop-ozone/pull/710#discussion_r397670171
 
 

 ##########
 File path: hadoop-ozone/dist/src/shell/hdds/hadoop-functions.sh
 ##########
 @@ -1541,6 +1541,21 @@ function hadoop_translate_cygwin_path
   fi
 }
 
+## @description  Adds default GC parameters
+## @description  Only for server components and only if no other -XX parameters
+## @description  are set
+## @audience     private
+## @stability    evolving
+## @replaceable  yes
+function hadoop_add_default_gc_opts
+{
+  if [[ "${HADOOP_SUBCMD_SUPPORTDAEMONIZATION}" == true ]]; then
+    hadoop_debug "Appending default GC parameter to the HADOOP_OPTS"
+    if [[ ! "$HADOOP_OPTS" =~ "-XX" ]] ; then
+       HADOOP_OPTS="${HADOOP_OPTS} -XX:ParallelGCThreads=8 
-XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 
-XX:+CMSParallelRemarkEnabled"
 
 Review comment:
   UseConcMarkSweepGC was 
[deprecated](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html)
 in JDK8.
   
   > -XX:+UseConcMarkSweepGC
   > Enables the use of the CMS garbage collector for the old generation. 
Oracle recommends that you use the CMS garbage collector when application 
latency requirements cannot be met by the throughput (-XX:+UseParallelGC) 
garbage collector. The G1 garbage collector (-XX:+UseG1GC) is another 
alternative.
   > 
   > By default, this option is disabled and the collector is chosen 
automatically based on the configuration of the machine and type of the JVM. 
When this option is enabled, the -XX:+UseParNewGC option is automatically set 
and you should not disable it, because the following combination of options has 
been deprecated in JDK 8: -XX:+UseConcMarkSweepGC -XX:-UseParNewGC.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org

Reply via email to