Heap size issue on migrating from Solr 5.0.0 to Solr 5.1.0

749 views Asked by At

I have a Solr 5.0.0 in production with a custom heap size like this

SOLR_JAVA_MEM="-Xms2g -Xmx2g"

When I tried to migrate to Solr 5.1.0 with the same configuration and start the server it returned a OutOfMemoryError. Looking to the Solr API I saw that the heap size was set to 512m. My custom heap configuration is not working in Solr 5.1.0 and the server is starting with the default heap size value.

2

There are 2 answers

0
Bruno dos Santos On BEST ANSWER

It's a bug that occurs just in Solr 5.1. There is an issue resolved that fixed this bug in Solr 5.2.

https://issues.apache.org/jira/browse/SOLR-7454

The problem is that Solr 5.1 doesn't use SOLR_JAVA_MEM to set heap size. It uses SOLR_HEAP to set the min and max heap sizes with the same value like this:

SOLR_HEAP="2g"

This way solr will start with -Xms=2g and -Xmx=2g

In Solr 5.2 this bug was fixed and the two SOLR_JAVA_MEM and SOLR_HEAP work fine.

0
Marvin Glenn Lacuna On

In my case, with the same SOLR version (v.5.0), I changed it in bin\solr.in.sh file.

enter image description here

There are other files that has "-Xms512m -Xmx512m", just be aware that those won't update the JVM Memory such as:

  1. bin\solr
  2. bin\solr.in.cmd
  3. bin\solr.cmd