Apache Solr open-source search software
SOLR-13394: Tweaking G1 parameters and adding ref guide documentation
Ishan Chattopadhyaya91969f40fe1d
diff --git a/solr/bin/solr b/solr/bin/solrindex 9b435f338e0..81e98a52695 100755--- a/solr/bin/solr+++ b/solr/bin/solr@@ -2021,10 +2021,9 @@ function start_solr() {GC_TUNE=('-XX:+UseG1GC' \'-XX:+PerfDisableSharedMem' \'-XX:+ParallelRefProcEnabled' \- '-XX:G1HeapRegionSize=16m' \'-XX:MaxGCPauseMillis=250' \- '-XX:InitiatingHeapOccupancyPercent=45' \- '-XX:+UseLargePages')+ '-XX:+UseLargePages' \+ '-XX:+AlwaysPreTouch')elseGC_TUNE=($GC_TUNE)fidiff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmdindex 2679a728a0f..bbe929fd540 100755--- a/solr/bin/solr.cmd+++ b/solr/bin/solr.cmd@@ -1170,10 +1170,9 @@ IF "%GC_TUNE%"=="" (set GC_TUNE=-XX:+UseG1GC ^-XX:+PerfDisableSharedMem ^-XX:+ParallelRefProcEnabled ^- -XX:G1HeapRegionSize=16m ^-XX:MaxGCPauseMillis=250 ^- -XX:InitiatingHeapOccupancyPercent=45 ^- -XX:+UseLargePages+ -XX:+UseLargePages ^+ -XX:+AlwaysPreTouch)if !JAVA_MAJOR_VERSION! GEQ 9 (diff --git a/solr/solr-ref-guide/src/taking-solr-to-production.adoc b/solr/solr-ref-guide/src/taking-solr-to-production.adocindex e4dcd951a5d..41b70d4738e 100644--- a/solr/solr-ref-guide/src/taking-solr-to-production.adoc+++ b/solr/solr-ref-guide/src/taking-solr-to-production.adoc@@ -186,7 +186,11 @@ By default, the `bin/solr` script sets the maximum Java heap size to 512M (-Xmx5SOLR_JAVA_MEM="-Xms10g -Xmx10g"-----Also, the <<solr-control-script-reference.adoc#solr-control-script-reference,Solr Control Script>> comes with a set of pre-configured Java Garbage Collection settings that have shown to work well with Solr for a number of different workloads. However, these settings may not work well for your specific use of Solr. Consequently, you may need to change the GC settings, which should also be done with the `GC_TUNE` variable in the `/etc/default/solr.in.sh` include file. For more information about tuning your memory and garbage collection settings, see: <<jvm-settings.adoc#jvm-settings,JVM Settings>>.+Also, the <<solr-control-script-reference.adoc#solr-control-script-reference,Solr Control Script>> comes with a set of pre-configured Garbage First Garbage Collection settings that have shown to work well with Solr for a number of different workloads.+However, these settings may not work well for your specific use of Solr. Consequently, you may need to change the GC settings, which should also be done with the `GC_TUNE` variable in the `/etc/default/solr.in.sh` include file. For more information about garbage collection settings refer to folowing articles:+1. https://wiki.apache.org/solr/ShawnHeisey+2. https://www.oracle.com/technetwork/articles/java/g1gc-1984535.html+You can also refer to <<jvm-settings.adoc#jvm-settings,JVM Settings>> for tuning your memory and garbage collection settings.==== Out-of-Memory Shutdown Hook