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?
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.
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.
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.
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
Change the memory pool settings, hit 'Apply' and restart the service.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With