On 10/12/2020 5:11 PM, Ryan W wrote:
Thanks.  How do I activate the G1GC collector?  Do I do this by editing a
config file, or by adding a parameter when I start solr?

Oracle's docs are pointing me to a file that supposedly is at
instance-dir/OUD/config/java.properties, but I don't have that path.  I am
not sure what is meant by instance-dir here, but perhaps it means my JRE
install, which is at
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre -- but
there is no "OUD" directory in this location.

The collector is chosen by the startup options given to Java, in this case by the start script for Solr. I've never heard of it being set by a config in the JRE.

In Solr 7, the start script defaults to the CMS collector. We have updated that to G1 in the latest Solr 8.x versions, because CMS has been deprecated by Oracle.

Adding the following lines to the correct solr.in.sh would change the garbage collector to G1. I got this from the "bin/solr" script in Solr 8.5.1:

      GC_TUNE=('-XX:+UseG1GC' \
        '-XX:+PerfDisableSharedMem' \
        '-XX:+ParallelRefProcEnabled' \
        '-XX:MaxGCPauseMillis=250' \
        '-XX:+UseLargePages' \
        '-XX:+AlwaysPreTouch')

If you used the service installer script to install Solr, then the correct file to add this to is usually /etc/default/solr.in.sh ... but if you did the install manually, it may be in the same bin directory that contains the solr script itself. Your initial message says the solr home is /opt/solr/server/solr so I am assuming it's not running on Windows.

Thanks,
Shawn

Reply via email to