2021-02-13 11:38:38 -08:00
|
|
|
## JVM configuration
|
|
|
|
|
|
|
|
################################################################
|
|
|
|
## 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
|
|
|
|
##
|
|
|
|
################################################################
|
|
|
|
|
|
|
|
# Xms represents the initial size of total heap space
|
|
|
|
# Xmx represents the maximum size of total heap space
|
|
|
|
|
2021-04-01 01:23:14 -07:00
|
|
|
-Xmn4G
|
|
|
|
-Xms8G
|
|
|
|
-Xmx8G
|
|
|
|
-XX:MaxMetaspaceSize=2G
|
2021-04-20 12:34:43 -07:00
|
|
|
-Xss1G
|
2021-04-01 01:23:14 -07:00
|
|
|
|
|
|
|
-Xnoclassgc
|
|
|
|
-XX:MaxDirectMemorySize=2G
|
|
|
|
|
|
|
|
-XX:InitialRAMPercentage=80
|
|
|
|
-XX:MaxRAMPercentage=80
|
|
|
|
-XX:MinRAMPercentage=80
|
2021-02-13 11:38:38 -08:00
|
|
|
|
|
|
|
################################################################
|
|
|
|
## Expert settings
|
|
|
|
################################################################
|
|
|
|
##
|
|
|
|
## All settings below this section are considered
|
|
|
|
## expert settings. Don't tamper with them unless
|
|
|
|
## you understand what you are doing
|
|
|
|
##
|
|
|
|
################################################################
|
|
|
|
|
|
|
|
## GC configuration
|
2021-04-01 01:23:14 -07:00
|
|
|
8-9:-XX:+UseConcMarkSweepGC
|
2021-02-13 11:38:38 -08:00
|
|
|
8-13:-XX:CMSInitiatingOccupancyFraction=75
|
|
|
|
8-13:-XX:+UseCMSInitiatingOccupancyOnly
|
|
|
|
|
|
|
|
## G1GC Configuration
|
|
|
|
# NOTE: G1 GC is only supported on JDK version 10 or later
|
|
|
|
# to use G1GC, uncomment the next two lines and update the version on the
|
|
|
|
# following three lines to your version of the JDK
|
|
|
|
# 10-13:-XX:-UseConcMarkSweepGC
|
|
|
|
# 10-13:-XX:-UseCMSInitiatingOccupancyOnly
|
2021-04-01 01:23:14 -07:00
|
|
|
11-:-XX:+UseG1GC
|
|
|
|
11-:-XX:G1ReservePercent=25
|
|
|
|
11-:-XX:InitiatingHeapOccupancyPercent=30
|
2021-02-13 11:38:38 -08:00
|
|
|
|
|
|
|
## JVM temporary directory
|
|
|
|
-Djava.io.tmpdir=${ES_TMPDIR}
|
|
|
|
|
|
|
|
## 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
|
|
|
|
|
|
|
|
# specify an alternative path for heap dumps; ensure the directory exists and
|
|
|
|
# has sufficient space
|
2021-04-01 01:23:14 -07:00
|
|
|
-XX:HeapDumpPath=/data
|
2021-02-13 11:38:38 -08:00
|
|
|
|
|
|
|
# specify an alternative path for JVM fatal error logs
|
2021-04-01 01:23:14 -07:00
|
|
|
-XX:ErrorFile=/var/log/hs_err_pid%p.log
|
2021-02-13 11:38:38 -08:00
|
|
|
|
|
|
|
## JDK 8 GC logging
|
|
|
|
8:-XX:+PrintGCDetails
|
|
|
|
8:-XX:+PrintGCDateStamps
|
|
|
|
8:-XX:+PrintTenuringDistribution
|
|
|
|
8:-XX:+PrintGCApplicationStoppedTime
|
|
|
|
8:-Xloggc:${ES_TMPDIR}/gc.log
|
|
|
|
8:-XX:+UseGCLogFileRotation
|
|
|
|
8:-XX:NumberOfGCLogFiles=32
|
|
|
|
8:-XX:GCLogFileSize=64m
|
|
|
|
|
|
|
|
# JDK 9+ GC logging
|
|
|
|
9-:-Xlog:gc*,gc+age=trace,safepoint:file=${ES_TMPDIR}/gc.log:utctime,pid,tags:filecount=32,filesize=64m
|