Skip to content

Commit ea3e208

Browse files
authored
update jvm for java21 (#186)
Signed-off-by: Thomas Kerber <[email protected]>
1 parent a1240e6 commit ea3e208

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

roles/linux/opensearch/templates/jvm.options

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
## -Xms4g
1212
## -Xmx4g
1313
##
14-
14+
## See https://opensearch.org/docs/opensearch/install/important-settings/
15+
## for more information
1516
##
1617
################################################################
1718

@@ -32,19 +33,19 @@
3233
################################################################
3334

3435
## GC configuration
35-
8-13:-XX:+UseConcMarkSweepGC
36-
8-13:-XX:CMSInitiatingOccupancyFraction=75
37-
8-13:-XX:+UseCMSInitiatingOccupancyOnly
36+
8-10:-XX:+UseConcMarkSweepGC
37+
8-10:-XX:CMSInitiatingOccupancyFraction=75
38+
8-10:-XX:+UseCMSInitiatingOccupancyOnly
3839

3940
## G1GC Configuration
40-
# NOTE: G1 GC is only supported on JDK version 10 or later
41-
# to use G1GC, uncomment the next two lines and update the version on the
42-
# following three lines to your version of the JDK
43-
# 10-13:-XX:-UseConcMarkSweepGC
44-
# 10-13:-XX:-UseCMSInitiatingOccupancyOnly
45-
14-:-XX:+UseG1GC
46-
14-:-XX:G1ReservePercent=25
47-
14-:-XX:InitiatingHeapOccupancyPercent=30
41+
# NOTE: G1GC is the default GC for all JDKs 11 and newer
42+
11-:-XX:+UseG1GC
43+
# See https://github.com/elastic/elasticsearch/pull/46169 for the history
44+
# behind these settings, but the tl;dr is that default values can lead
45+
# to situations where heap usage grows enough to trigger a circuit breaker
46+
# before GC kicks in.
47+
11-:-XX:G1ReservePercent=25
48+
11-:-XX:InitiatingHeapOccupancyPercent=30
4849

4950
## JVM temporary directory
5051
-Djava.io.tmpdir=${OPENSEARCH_TMPDIR}
@@ -74,3 +75,14 @@
7475

7576
# JDK 9+ GC logging
7677
9-:-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m
78+
79+
# JDK 20+ Incubating Vector Module for SIMD optimizations;
80+
# disabling may reduce performance on vector optimized lucene
81+
20-:--add-modules=jdk.incubator.vector
82+
83+
# See please https://bugs.openjdk.org/browse/JDK-8341127 (openjdk/jdk#21283)
84+
23:-XX:CompileCommand=dontinline,java/lang/invoke/MethodHandle.setAsTypeCache
85+
23:-XX:CompileCommand=dontinline,java/lang/invoke/MethodHandle.asTypeUncached
86+
87+
21-:-javaagent:agent/opensearch-agent.jar
88+
21-:--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED

0 commit comments

Comments
 (0)