Memory -Xmx and -Xms "should" be the same... how severely "should" we heed this recommendation?

https://github.com/elastic/elasticsearch/blob/master/docs/reference/setup/important-settings/heap-size.asciidoc#heap-size-settings mentions:

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.

That -Xms and -Xmx are set to the same value is enforced by a bootstrap check at startup, so it's not even possible to set them to different values when running in production.

Ok. https://github.com/elastic/elasticsearch/pull/64090 to clarify

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.