Skip to content

Commit

Permalink
stealing all java settings from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonTheMain committed Oct 11, 2024
1 parent d1092da commit 45ddeee
Showing 1 changed file with 33 additions and 5 deletions.
38 changes: 33 additions & 5 deletions jobs/opensearch/templates/config/jvm.options.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@
## -Xms4g
## -Xmx4g
##
## See https://www.open.co/guide/en/opensearch/reference/current/heap-size.html
## See https://opensearch.org/docs/opensearch/install/important-settings/
## for more information
##
################################################################

# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space

#-Xms2g
#-Xmx2g

-XX:+DisableExplicitGC
-Xms${heap.min}
-Xmx${heap.max}

################################################################
## Expert settings
Expand All @@ -49,6 +47,36 @@
11-:-XX:G1ReservePercent=25
11-:-XX:InitiatingHeapOccupancyPercent=30


## heap dumps

# generate a heap dump when an allocation from the Java heap fails
# heap dumps are created in the working directory of the JVM
-XX:+HeapDumpOnOutOfMemoryError

## JDK 8 GC logging
8:-XX:+PrintGCDetails
8:-XX:+PrintGCDateStamps
8:-XX:+PrintTenuringDistribution
8:-XX:+PrintGCApplicationStoppedTime
8:-Xloggc:${loggc}
8:-XX:+UseGCLogFileRotation
8:-XX:NumberOfGCLogFiles=32
8:-XX:GCLogFileSize=64m

# JDK 9+ GC logging
9-:-Xlog:gc*,gc+age=trace,safepoint:file=${loggc}:utctime,pid,tags:filecount=32,filesize=64m

# Explicitly allow security manager (https://bugs.openjdk.java.net/browse/JDK-8270380)
18-:-Djava.security.manager=allow

# JDK 20+ Incubating Vector Module for SIMD optimizations;
# disabling may reduce performance on vector optimized lucene
20-:--add-modules=jdk.incubator.vector

# HDFS ForkJoinPool.common() support by SecurityManager
-Djava.util.concurrent.ForkJoinPool.common.threadFactory=org.opensearch.secure_sm.SecuredForkJoinWorkerThreadFactory

## optimizations

# ensure UTF-8 encoding by default (e.g. filenames)
Expand Down

0 comments on commit 45ddeee

Please sign in to comment.