From cb1be6cafd6d1f13f6bb99ce030af750e92da35d Mon Sep 17 00:00:00 2001 From: mmahacek Date: Mon, 28 Apr 2025 14:04:52 -0700 Subject: [PATCH 1/4] Reference: default JVM heap calculation --- docs/reference/elasticsearch/jvm-settings.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/reference/elasticsearch/jvm-settings.md b/docs/reference/elasticsearch/jvm-settings.md index eb334fd6ee2be..01c24aa262123 100644 --- a/docs/reference/elasticsearch/jvm-settings.md +++ b/docs/reference/elasticsearch/jvm-settings.md @@ -128,6 +128,18 @@ If you are running {{es}} as a Windows service, you can change the heap size usi :::: +## Default JVM heap sizes [default-jvm-sizes] + +If heap sizes are not specifically set, {{es}} will calculate JVM heap sizing based on the total amount of system memory, depending on the node's role. + +* Master-only node + * 60% of total system memory, up to a maximum of 31 GB. +* Machine Learning-only node + * 40% of the first 16 gigabytes plus 10% of memory above that when total system memory is more than 16 gigabytes, up to a maximum of 31 GB. +* Data-only node + * 40% of total system memory when less than 1 GB, with a minimum of 128 MB. + * 50% of total system memory when more than 1 GB, with a maximum of 31 GB. + ## JVM heap dump path setting [heap-dump-path-setting] From 6e14170f736f7c37598ff9e0b80ff1aeaf1ec559 Mon Sep 17 00:00:00 2001 From: mmahacek Date: Mon, 28 Apr 2025 14:07:34 -0700 Subject: [PATCH 2/4] Update docs/reference/elasticsearch/jvm-settings.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docs/reference/elasticsearch/jvm-settings.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/elasticsearch/jvm-settings.md b/docs/reference/elasticsearch/jvm-settings.md index 01c24aa262123..46239bcc80ab9 100644 --- a/docs/reference/elasticsearch/jvm-settings.md +++ b/docs/reference/elasticsearch/jvm-settings.md @@ -138,7 +138,7 @@ If heap sizes are not specifically set, {{es}} will calculate JVM heap sizing ba * 40% of the first 16 gigabytes plus 10% of memory above that when total system memory is more than 16 gigabytes, up to a maximum of 31 GB. * Data-only node * 40% of total system memory when less than 1 GB, with a minimum of 128 MB. - * 50% of total system memory when more than 1 GB, with a maximum of 31 GB. + * 50% of total system memory when 1 GB or more, with a maximum of 31 GB. ## JVM heap dump path setting [heap-dump-path-setting] From 6bb3875c42a8c53d5ada45ac8561d08e34fafd56 Mon Sep 17 00:00:00 2001 From: mmahacek Date: Tue, 29 Apr 2025 11:08:37 -0700 Subject: [PATCH 3/4] Update jvm-settings.md --- docs/reference/elasticsearch/jvm-settings.md | 23 ++++++++------------ 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/docs/reference/elasticsearch/jvm-settings.md b/docs/reference/elasticsearch/jvm-settings.md index 46239bcc80ab9..ff87cc283588c 100644 --- a/docs/reference/elasticsearch/jvm-settings.md +++ b/docs/reference/elasticsearch/jvm-settings.md @@ -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: + +* Master-only node + * 60% of total system memory, up to a maximum of 31 GB. +* Machine Learning-only node + * 40% of the first 16 gigabytes plus 10% of memory above that when total system memory is more than 16 gigabytes, up to a maximum of 31 GB. +* Data-only node + * 40% of total system memory when less than 1 GB, with a minimum of 128 MB. + * 50% of total system memory when 1 GB or more, with a maximum of 31 GB. 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. @@ -128,19 +136,6 @@ If you are running {{es}} as a Windows service, you can change the heap size usi :::: -## Default JVM heap sizes [default-jvm-sizes] - -If heap sizes are not specifically set, {{es}} will calculate JVM heap sizing based on the total amount of system memory, depending on the node's role. - -* Master-only node - * 60% of total system memory, up to a maximum of 31 GB. -* Machine Learning-only node - * 40% of the first 16 gigabytes plus 10% of memory above that when total system memory is more than 16 gigabytes, up to a maximum of 31 GB. -* Data-only node - * 40% of total system memory when less than 1 GB, with a minimum of 128 MB. - * 50% of total system memory when 1 GB or more, with a maximum of 31 GB. - - ## 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. From e679307f02594bbddbf29ba12f803ed85942cf2d Mon Sep 17 00:00:00 2001 From: mmahacek Date: Tue, 29 Apr 2025 11:10:10 -0700 Subject: [PATCH 4/4] Update jvm-settings.md --- docs/reference/elasticsearch/jvm-settings.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/reference/elasticsearch/jvm-settings.md b/docs/reference/elasticsearch/jvm-settings.md index ff87cc283588c..5c5f7f8ee7507 100644 --- a/docs/reference/elasticsearch/jvm-settings.md +++ b/docs/reference/elasticsearch/jvm-settings.md @@ -81,15 +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. The default heap sizing uses the following formulas: +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, up to a maximum of 31 GB. + * 60% of total system memory * Machine Learning-only node - * 40% of the first 16 gigabytes plus 10% of memory above that when total system memory is more than 16 gigabytes, up to a maximum of 31 GB. + * 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 1 GB, with a minimum of 128 MB. - * 50% of total system memory when 1 GB or more, with a maximum of 31 GB. + * 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.