The jvm.options file contains JVM settings for an Elasticsearch node, including heap-memory options. Treat the file under config as reference-only: never edit it directly. section 14.5.3
To change heap memory or other JVM settings, create a separate file with the fixed .options extension and place it in jvm.options.d. Elasticsearch’s automatic heap setting means customization should be deliberate. section 14.5.3
For a node that needs custom heap settings:
- Create a file such as jvm_custom.options; the filename may vary, but the .options extension is required. section 14.5.3
- Place it in config/jvm.options.d for archive installations, /etc/elasticsearch/jvm.options.d/ for RPM/Debian installations, or mount it under /usr/share/elasticsearch/config for Docker. section 14.5.3
- Use -Xms for initial heap memory and -Xmx for maximum heap memory. section 14.5.3
- Keep both heap settings at or below roughly 50% of the node’s total RAM, leaving the remaining memory for Lucene segmentation, caching, and other processes. section 14.5.3
A focused listing shows a custom heap configuration using separate initial and maximum heap values. section 14.5.3
