Q:

Heap size issue on migrating from Solr 5.0.0 to Solr 5.1.0

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. 

A:

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.