Skip to content

Reference: default JVM heap calculation #127482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions docs/reference/elasticsearch/jvm-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,15 @@ If you’re using the RPM or Debian packages, you can specify `ES_JAVA_OPTS` in

## Set the JVM heap size [set-jvm-heap-size]

By default, {{es}} automatically sets the JVM heap size based on a node’s [roles](/reference/elasticsearch/configuration-reference/node-settings.md#node-roles) and total memory. Using the default sizing is recommended for most production environments.
By default, {{es}} automatically sets the JVM heap size based on a node’s [roles](/reference/elasticsearch/configuration-reference/node-settings.md#node-roles) and total memory. Using the default sizing is recommended for most production environments. The default heap sizing uses the following formulas, with a maximum heap limit of 31GB:

* Master-only node
* 60% of total system memory
* Machine Learning-only node
* 40% of the first 16GB plus 10% of memory above that when total system memory is more than 16GB
* Data-only node
* 40% of total system memory when less than 1GB, with a minimum of 128MB
* 50% of total system memory when 1GB or more

To override the default heap size, set the minimum and maximum heap size settings, `Xms` and `Xmx`. The minimum and maximum values must be the same.

Expand Down Expand Up @@ -128,7 +136,6 @@ If you are running {{es}} as a Windows service, you can change the heap size usi
::::



## JVM heap dump path setting [heap-dump-path-setting]

By default, {{es}} configures the JVM to dump the heap on out of memory exceptions to the default logs directory. On [RPM](docs-content://deploy-manage/deploy/self-managed/install-elasticsearch-with-rpm.md) and [Debian](docs-content://deploy-manage/deploy/self-managed/install-elasticsearch-with-debian-package.md) packages, the logs directory is `/var/log/elasticsearch`. On [Linux and MacOS](docs-content://deploy-manage/deploy/self-managed/install-elasticsearch-from-archive-on-linux-macos.md) and [Windows](docs-content://deploy-manage/deploy/self-managed/install-elasticsearch-with-zip-on-windows.md) distributions, the `logs` directory is located under the root of the {{es}} installation.
Expand Down
Loading