Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elasticsearch reports default heap memory size after setting environment variable

In attempt to increase JVM heap size for Elasticsearch on a Windows box, I defined the following environment variable:

ES_HEAP_SIZE=6g

(The machine has 12G RAM in total).

I have restarted ES and queried its memory usage using _nodes/stat HTTP GET command. However, it seems that it's still using 1GB:

mem: {

heap_used_in_bytes: 1032367576,
heap_used_percent: 99,
heap_committed_in_bytes: 1037959168,
heap_max_in_bytes: 1037959168,
...

Shouldn't ES adjust its heap memory size after the restart?

like image 245
Vagif Abilov Avatar asked Nov 25 '14 13:11

Vagif Abilov


People also ask

What is the default heap size?

Again the maximum default heap size is 256MB for all servers (dmgr, nodeagent and application servers) and The minimum default heap size is 50 MB. Please review the following link for more information. The default maximum heap size for any distributed(AIX, Solaris, windows etc) operating system is 256 MB.

What is Elasticsearch heap size?

Elasticsearch clusters and JVM Heap SizeThe ideal heap size is somewhere below 32 GB, as heap sizes above 32 GB become less efficient. What these recommendations mean is that on a 64 GB cluster, we dedicate 32 GB to the Elasticsearch heap and 32 GB to the operating system in the container that hosts your cluster.

How Elasticsearch reduce JVM memory usage?

You can lower the JVM memory pressure by reducing the number of shards or upgrading to a larger cluster. For guidelines, check How to size your shards. If JVM memory pressure above 75% happens only occasionally, this is often due to expensive queries.


1 Answers

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

like image 177
Akshay Avatar answered Oct 19 '22 10:10

Akshay