diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index ea385dc7494..c6aa3c25999 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -98,6 +98,8 @@ Upgrade Notes * Custom TransientSolrCoreCache implementations no longer use the Observer/Observable pattern. To notify Solr that a core has been aged out of the cache, call CoreContainer.queueCoreToClose(SolrCore). See SOLR-13400 for details. +* SOLR-13394: The default GC has been changed from CMS to G1. To override this (in order to switch to CMS or any + other GC), use GC_TUNE section of bin/solr.in.sh or bin/solr.in.cmd. New Features ---------------------- @@ -243,6 +245,10 @@ Improvements * SOLR-12167: Throw an exception, instead of just a warning, when unknown atomic update operation is encountered (Munendra S N via Ishan Chattopadhyaya) +* SOLR-13394: Switch default GC from CMS to G1 (Ishan Chattopadhyaya, Kesharee Nandan Vishwakarma, Shawn Heisey, + Uwe Schindler, Erick Ericsson) + + Other Changes ---------------------- diff --git a/solr/bin/solr b/solr/bin/solr index 8306609ca60..1d01ded2fd2 100755 --- a/solr/bin/solr +++ b/solr/bin/solr @@ -2018,20 +2018,13 @@ function start_solr() { # define default GC_TUNE if [ -z ${GC_TUNE+x} ]; then - GC_TUNE=('-XX:NewRatio=3' \ - '-XX:SurvivorRatio=4' \ - '-XX:TargetSurvivorRatio=90' \ - '-XX:MaxTenuringThreshold=8' \ - '-XX:+UseConcMarkSweepGC' \ - '-XX:ConcGCThreads=4' '-XX:ParallelGCThreads=4' \ - '-XX:+CMSScavengeBeforeRemark' \ - '-XX:PretenureSizeThreshold=64m' \ - '-XX:+UseCMSInitiatingOccupancyOnly' \ - '-XX:CMSInitiatingOccupancyFraction=50' \ - '-XX:CMSMaxAbortablePrecleanTime=6000' \ - '-XX:+CMSParallelRemarkEnabled' \ + GC_TUNE=('-XX:+UseG1GC' \ + '-XX:+PerfDisableSharedMem' \ '-XX:+ParallelRefProcEnabled' \ - '-XX:-OmitStackTraceInFastThrow') + '-XX:G1HeapRegionSize=16m' \ + '-XX:MaxGCPauseMillis=250' \ + '-XX:InitiatingHeapOccupancyPercent=45' \ + '-XX:+UseLargePages') else GC_TUNE=($GC_TUNE) fi diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd index d3932bfc177..2679a728a0f 100755 --- a/solr/bin/solr.cmd +++ b/solr/bin/solr.cmd @@ -1167,20 +1167,13 @@ set SOLR_OPTS=%SOLR_JAVA_STACK_SIZE% %SOLR_OPTS% IF "%SOLR_TIMEZONE%"=="" set SOLR_TIMEZONE=UTC IF "%GC_TUNE%"=="" ( - set GC_TUNE=-XX:NewRatio=3 ^ - -XX:SurvivorRatio=4 ^ - -XX:TargetSurvivorRatio=90 ^ - -XX:MaxTenuringThreshold=8 ^ - -XX:+UseConcMarkSweepGC ^ - -XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 ^ - -XX:+CMSScavengeBeforeRemark ^ - -XX:PretenureSizeThreshold=64m ^ - -XX:+UseCMSInitiatingOccupancyOnly ^ - -XX:CMSInitiatingOccupancyFraction=50 ^ - -XX:CMSMaxAbortablePrecleanTime=6000 ^ - -XX:+CMSParallelRemarkEnabled ^ - -XX:+ParallelRefProcEnabled ^ - -XX:-OmitStackTraceInFastThrow + set GC_TUNE=-XX:+UseG1GC ^ + -XX:+PerfDisableSharedMem ^ + -XX:+ParallelRefProcEnabled ^ + -XX:G1HeapRegionSize=16m ^ + -XX:MaxGCPauseMillis=250 ^ + -XX:InitiatingHeapOccupancyPercent=45 ^ + -XX:+UseLargePages ) if !JAVA_MAJOR_VERSION! GEQ 9 ( diff --git a/solr/bin/solr.in.cmd b/solr/bin/solr.in.cmd index 639f7e9d6a8..38491953f8d 100755 --- a/solr/bin/solr.in.cmd +++ b/solr/bin/solr.in.cmd @@ -34,7 +34,20 @@ REM set GC_LOG_OPTS=-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+Prin REM Various GC settings have shown to work well for a number of common Solr workloads. REM See solr.cmd GC_TUNE for the default list. -REM set GC_TUNE=-XX:NewRatio=3 -XX:SurvivorRatio=4 etc. +REM set GC_TUNE=-XX:SurvivorRatio=4 +REM set GC_TUNE=%GC_TUNE% -XX:TargetSurvivorRatio=90 +REM set GC_TUNE=%GC_TUNE% -XX:MaxTenuringThreshold=8 +REM set GC_TUNE=%GC_TUNE% -XX:+UseConcMarkSweepGC +REM set GC_TUNE=%GC_TUNE% -XX:ConcGCThreads=4 +REM set GC_TUNE=%GC_TUNE% -XX:ParallelGCThreads=4 +REM set GC_TUNE=%GC_TUNE% -XX:+CMSScavengeBeforeRemark +REM set GC_TUNE=%GC_TUNE% -XX:PretenureSizeThreshold=64m +REM set GC_TUNE=%GC_TUNE% -XX:+UseCMSInitiatingOccupancyOnly +REM set GC_TUNE=%GC_TUNE% -XX:CMSInitiatingOccupancyFraction=50 +REM set GC_TUNE=%GC_TUNE% -XX:CMSMaxAbortablePrecleanTime=6000 +REM set GC_TUNE=%GC_TUNE% -XX:+CMSParallelRemarkEnabled +REM set GC_TUNE=%GC_TUNE% -XX:+ParallelRefProcEnabled +REM set GC_TUNE=%GC_TUNE% -XX:-OmitStackTraceInFastThrow etc. REM Set the ZooKeeper connection string if using an external ZooKeeper ensemble REM e.g. host1:2181,host2:2181/chroot diff --git a/solr/bin/solr.in.sh b/solr/bin/solr.in.sh index b67f7701b73..832e3cbf550 100644 --- a/solr/bin/solr.in.sh +++ b/solr/bin/solr.in.sh @@ -46,7 +46,20 @@ # -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime" # These GC settings have shown to work well for a number of common Solr workloads -#GC_TUNE="-XX:NewRatio=3 -XX:SurvivorRatio=4 etc. +#GC_TUNE=" \ +#-XX:SurvivorRatio=4 \ +#-XX:TargetSurvivorRatio=90 \ +#-XX:MaxTenuringThreshold=8 \ +#-XX:+UseConcMarkSweepGC \ +#-XX:ConcGCThreads=4 -XX:ParallelGCThreads=4 \ +#-XX:+CMSScavengeBeforeRemark \ +#-XX:PretenureSizeThreshold=64m \ +#-XX:+UseCMSInitiatingOccupancyOnly \ +#-XX:CMSInitiatingOccupancyFraction=50 \ +#-XX:CMSMaxAbortablePrecleanTime=6000 \ +#-XX:+CMSParallelRemarkEnabled \ +#-XX:+ParallelRefProcEnabled \ +#-XX:-OmitStackTraceInFastThrow etc. # Set the ZooKeeper connection string if using an external ZooKeeper ensemble # e.g. host1:2181,host2:2181/chroot