From 7297580170ea0e00f8df6b17626e5b77f4512f79 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 13 Apr 2016 09:01:56 -0400 Subject: [PATCH] Simplify JVM options This commit simplifies the default JVM options that ship with Elasticsearch. In particular, expert settings that were previously configurable via environment variables have been removed from the default configuration file. Further, the heap size settings have been moved to the top of the file with a clearer message that is in concordance with their importance. Closes #17714 --- .../src/main/resources/config/jvm.options | 70 +++++++++++-------- 1 file changed, 39 insertions(+), 31 deletions(-) diff --git a/distribution/src/main/resources/config/jvm.options b/distribution/src/main/resources/config/jvm.options index 691d681c05e..e82b9c245c2 100644 --- a/distribution/src/main/resources/config/jvm.options +++ b/distribution/src/main/resources/config/jvm.options @@ -1,41 +1,38 @@ -### configuration +## JVM configuration -## basic +################################################################ +## IMPORTANT: JVM heap size +################################################################ +## +## You should always set the min and max JVM heap +## size to the same value. For example, to set +## the heap to 4 GB, set: +## +## -Xms4g +## -Xmx4g +## +## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html +## for more information +## +################################################################ -# set to headless, just in case --Djava.awt.headless=true +# Xms represents the initial size of total heap space +# Xmx represents the maximum size of total heap space -# ensure UTF-8 encoding by default (e.g. filenames) --Dfile.encoding=UTF-8 - -# use our provided JNA always versus the system one --Djna.nosys=true - -## networking - -# force the JVM to use the IPv4 stack -#-Djava.net.preferIPv4Stack=true - -### memory - -## heap configuration - -# minimum size of total heap space -Xms${heap.min} - -# maximum size of total heap space -# it is recommended to set the minimum size and maximum size equal to -# each other to prevent pauses upon resize, and so that memory locking -# will lock the entire heap in physical memory -Xmx${heap.max} -# size of young generation heap space -#-Xmn${new.size} +################################################################ +## Expert settings +################################################################ +## +## All settings below this section are considered +## expert settings. Don't tamper with them unless +## you understand what you are doing +## +################################################################ -# maximum size of NIO direct-buffer allocations -#-XX:MaxDirectMemorySize${max.direct.memory.size} - -## CMS configuration +## GC configuration -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 @@ -49,6 +46,17 @@ # pre-touch memory pages used by the JVM during initialization -XX:+AlwaysPreTouch +## basic + +# set to headless, just in case +-Djava.awt.headless=true + +# ensure UTF-8 encoding by default (e.g. filenames) +-Dfile.encoding=UTF-8 + +# use our provided JNA always versus the system one +-Djna.nosys=true + ## heap dumps # generate a heap dump when an allocation from the Java heap fails