Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit b32481a

Browse files
authored
Update jvm options with default values for 7.6.0 (#691)
* update jvm options with default values for 7.6.0 * allow overriding heap dump path
1 parent 744e65c commit b32481a

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ es_debian_startup_timeout: 10
4949
# JVM custom parameters
5050
es_java_home: ''
5151
es_jvm_custom_parameters: ''
52+
es_heap_dump_path: "/var/lib/elasticsearch"
5253

5354
# SSL/TLS parameters
5455
es_enable_auto_ssl_configuration: true

templates/jvm.options.j2

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,19 @@
3737
################################################################
3838

3939
## GC configuration
40+
{% if es_version is version('7.6.0', '<') %}
4041
-XX:+UseConcMarkSweepGC
4142
-XX:CMSInitiatingOccupancyFraction=75
4243
-XX:+UseCMSInitiatingOccupancyOnly
44+
{% else %}
45+
8-13:-XX:+UseConcMarkSweepGC
46+
8-13:-XX:CMSInitiatingOccupancyFraction=75
47+
8-13:-XX:+UseCMSInitiatingOccupancyOnly
48+
{% endif %}
4349

4450
## G1GC Configuration
45-
# NOTE: G1GC is only supported on JDK version 10 or later.
51+
# NOTE: G1 GC is only supported on JDK version 10 or later
52+
{% if es_version is version('7.6.0', '<') %}
4653
# To use G1GC uncomment the lines below.
4754
# 10-:-XX:-UseConcMarkSweepGC
4855
# 10-:-XX:-UseCMSInitiatingOccupancyOnly
@@ -53,6 +60,15 @@
5360
# 10-:-XX:G1ReservePercent=25
5461
# 10-:-XX:InitiatingHeapOccupancyPercent=30
5562
{% endif %}
63+
{% else %}
64+
# to use G1GC, uncomment the next two lines and update the version on the
65+
# following three lines to your version of the JDK
66+
# 10-13:-XX:-UseConcMarkSweepGC
67+
# 10-13:-XX:-UseCMSInitiatingOccupancyOnly
68+
14-:-XX:+UseG1GC
69+
14-:-XX:G1ReservePercent=25
70+
14-:-XX:InitiatingHeapOccupancyPercent=30
71+
{% endif %}
5672

5773
{% if es_version is version('7.5.0', '<') %}
5874
## DNS cache policy
@@ -100,6 +116,7 @@
100116
-Dlog4j2.disable.jmx=true
101117
{% endif %}
102118

119+
## JVM temporary directory
103120
-Djava.io.tmpdir=${ES_TMPDIR}
104121

105122
## heap dumps
@@ -110,7 +127,7 @@
110127

111128
# specify an alternative path for heap dumps; ensure the directory exists and
112129
# has sufficient space
113-
-XX:HeapDumpPath=${heap.dump.path}
130+
-XX:HeapDumpPath={{ es_heap_dump_path }}
114131

115132
# specify an alternative path for JVM fatal error logs
116133
-XX:ErrorFile={{ es_log_dir }}/hs_err_pid%p.log

0 commit comments

Comments
 (0)