File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ if [[ "${INSTANCE_RAM:-}" =~ $regex ]]; then
39
39
fi
40
40
41
41
# determine if req is less then max recommended by ES
42
- echo " Comparing the specificed RAM to the maximum recommended for ElasticSearch ..."
42
+ echo " Comparing the specified RAM to the maximum recommended for Elasticsearch ..."
43
43
if [ ${MAX_ES_MEMORY_BYTES} -lt ${num} ]; then
44
44
(( num = ${MAX_ES_MEMORY_BYTES} ))
45
45
echo " Downgrading the INSTANCE_RAM to $(( $num / BYTES_PER_MEG)) m because ${INSTANCE_RAM} will result in a larger heap then recommended."
@@ -55,15 +55,18 @@ if [[ "${INSTANCE_RAM:-}" =~ $regex ]]; then
55
55
echo " Setting the maximum allowable RAM to $(( $num / BYTES_PER_MEG)) m which is the largest amount available"
56
56
fi
57
57
else
58
- echo " Unable to determine the maximum allowable RAM for this host in order to configure ElasticSearch "
58
+ echo " Unable to determine the maximum allowable RAM for this host in order to configure Elasticsearch "
59
59
exit 1
60
60
fi
61
61
62
62
if [[ $num -lt $MIN_ES_MEMORY_BYTES ]]; then
63
63
echo " A minimum of $(( $MIN_ES_MEMORY_BYTES / $BYTES_PER_MEG )) m is required but only $(( $num / $BYTES_PER_MEG )) m is available or was specified"
64
64
exit 1
65
65
fi
66
- export ES_JAVA_OPTS=" ${ES_JAVA_OPTS:- } -Xms128M -Xmx$(( $num / 2 / BYTES_PER_MEG)) m"
66
+
67
+ # Set JVM HEAP size to half of available space
68
+ num=$(( $num / 2 / BYTES_PER_MEG))
69
+ export ES_JAVA_OPTS=" ${ES_JAVA_OPTS:- } -Xms${num} m -Xmx${num} m"
67
70
echo " ES_JAVA_OPTS: '${ES_JAVA_OPTS} '"
68
71
else
69
72
echo " INSTANCE_RAM env var is invalid: ${INSTANCE_RAM:- } "
You can’t perform that action at this time.
0 commit comments