mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
bin: elasticsearch script to support ES_HEAP_SIZE to easily set the heap size to a single value (min and max) and ES_HEAP_NEWSIZE to optionally set the new gen, closes #1671.
This commit is contained in:
parent
abfc570762
commit
43809211d4
Binary file not shown.
@ -6,6 +6,10 @@ fi
|
||||
if [ "x$ES_MAX_MEM" = "x" ]; then
|
||||
ES_MAX_MEM=1g
|
||||
fi
|
||||
if [ "x$ES_HEAP_SIZE" != "x" ]; then
|
||||
ES_MIN_MEM=$ES_HEAP_SIZE
|
||||
ES_MAX_MEM=$ES_HEAP_SIZE
|
||||
fi
|
||||
|
||||
# min and max heap sizes should be set to the same value to avoid
|
||||
# stop-the-world GC pauses during resize, and so that we can lock the
|
||||
@ -14,6 +18,11 @@ fi
|
||||
JAVA_OPTS="$JAVA_OPTS -Xms${ES_MIN_MEM}"
|
||||
JAVA_OPTS="$JAVA_OPTS -Xmx${ES_MAX_MEM}"
|
||||
|
||||
# new generation
|
||||
if [ "x$ES_HEAP_NEWSIZE" != "x" ]; then
|
||||
JAVA_OPTS="$JAVA_OPTS -Xmn${ES_HEAP_NEWSIZE}"
|
||||
fi
|
||||
|
||||
# reduce the per-thread stack size
|
||||
JAVA_OPTS="$JAVA_OPTS -Xss128k"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user