Elasticsearch will assign the entire heap specified in jvm.options via the Xms (minimum heap size) and Xmx (maximum heap size) settings. You should set these two settings to equal each other.
This "should" has been around for a while, but we can't find specific information about this recommendation.
- In what situations "must" we set the values to be the same?
- In what situations is it reasonable to set a different value?
- Is it reasonable to set
-Xms 64m
and then have-Xmx
scale relative to the physical memory on the machine (less than 50% of the allocatable memory)?
Our context is that we are bundling Elasticsearch to be deployed on machines together with other data analytics applications. So we need to "play nicely" with other Java services, and we are thinking to not pre-allocate too much heap, unless it's necessary.
We have evaluated our particular indices usage of Elasticsearch's layers of caches, and feel like if the heap allocation is decreased during operation (evicting some cache), it wouldn't significantly affect our operations.