ndimiduk commented on a change in pull request #1527: HBASE-24143 [JDK11] 
Switch default garbage collector from CMS
URL: https://github.com/apache/hbase/pull/1527#discussion_r410381772
 
 

 ##########
 File path: bin/hbase
 ##########
 @@ -136,6 +136,21 @@ if [ -f "$HBASE_HOME/conf/hbase-env-$COMMAND.sh" ]; then
   . "$HBASE_HOME/conf/hbase-env-$COMMAND.sh"
 fi
 
+# establish a default value for HBASE_OPTS if it's not already set. For now,
+# all we set is the garbage collector.
+if [ -z "${HBASE_OPTS}" ] ; then
+  major_version_number="$(parse_java_major_version "$(read_java_version)")"
+  case "$major_version_number" in
+  8|9|10)
+    HBASE_OPTS="-XX:+UseConcMarkSweepGC"
+    ;;
+  11|*)
+    HBASE_OPTS="-XX:+UseG1GC"
 
 Review comment:
   The benefit of setting it in `HBASE_OPTS` is that it gets picked up by all 
of our launch contexts. Moving it out to the `*_GC_OPTS` variables is probably 
a larger refactor effort.
   
   Also not discussed here is the API compatibility around these variables. 
Moving GC selection out of `HBASE_OPTS` is definitely a conceptual change. Even 
changing the behavior from always-appends-the collector-selection to 
only-sets-when-`HBASE_OPTS`-is-empty is also compatibility change.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to