liveBook · Manning

Jvm.options

As explained in Elasticsearch in Action, Second Edition

An Elasticsearch configuration file containing options for the Java Virtual Machine, including heap-memory settings.

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
Listing 14.16 Upgrading heap memory
-Xms4g
-Xmx8g

A focused listing shows a custom heap configuration using separate initial and maximum heap values. section 14.5.3

How Elasticsearch in Action, Second Edition covers it

How deep it goes
Explains file placement, edit restrictions, heap flags, and memory guidance without developing broader JVM performance tuning.
Examples
Uses jvm_custom.options with -Xms4g and -Xmx8g as a heap-upgrade example.
What it assumes
Assumes familiarity with an Elasticsearch installation and node memory; teaches the file-safety rule and custom-file workflow.
What you can do after
Operate/configure custom JVM settings by creating an .options file in the installation’s jvm.options.d directory.
How it connects
Connects JVM options with heap memory, Elasticsearch nodes, Lucene caching, and installation layouts.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Elasticsearch in Action, Second Edition. The section links point to the parts of the book it draws on.