Elasticsearch reports default heap memory size after setting environment variable Elasticsearch reports default heap memory size after setting environment variable elasticsearch elasticsearch

Elasticsearch reports default heap memory size after setting environment variable


From the notes on running ES as a service on windows:

Note that the environment configuration options available during the installation are copied and will be used during the service lifecycle. This means any changes made to them after the installation will not be picked up unless the service is reinstalled.

If you don't want to uninstall and re-install, you can use the service manager to make the change. Run >service manager

Then select the 'Java' Tab

Java Tab

Change the memory pool settings, hit 'Apply' and restart the service.

enter image description here


After I had uninstalled and reinstalled Elasticsearch Windows service, it correctly increased the JVM heap size. Just restarting it without reinstalling the service didn't work.


For Elastic Search 1.5

One way to do it is to edit the /bin/elasticsearch.in.sh file to default to some other value that 1g. For your example, change the ES_MAX_MEM=1g for ES_MAX_MEM=6g. After editing, restart Elastic Search and you should be good.

#!/bin/shES_CLASSPATH=$ES_CLASSPATH:$ES_HOME/lib/elasticsearch-1.5.0.jar:$ES_HOME/lib/*:$ES_HOME/lib/sigar/*if [ "x$ES_MIN_MEM" = "x" ]; then    ES_MIN_MEM=256mfiif [ "x$ES_MAX_MEM" = "x" ]; then    ES_MAX_MEM=6gfiif [ "x$ES_HEAP_SIZE" != "x" ]; then    ES_MIN_MEM=$ES_HEAP_SIZE    ES_MAX_MEM=$ES_HEAP_SIZEfi