In the documentation, it states:
This chart will automatically calculate Java heap size from given resources.requests.memory value. If you want to specify number of heap size, you can set graylog.heapSize to your desired value. The graylog.heapSize value must be in JVM -Xmx format.
So, we all incorrectly assumed this meant that if we do not specify a graylog.heapSize in our values, it will default to our resources.requests.memory value, which we are specifying like so in our values file:
graylog:
replicas: 2
resources:
requests:
cpu: "1000m"
memory: "7Gi"
limits:
memory: "9Gi"
To my surprise, I saw Graylog regularly consuming > 13GB of memory. It turns out, the documentation is incorrect, because 16g is hard-coded to the default values here:
|
## Set Graylog Java heapsize. If this value empty, chart will allocate heapsize using `-XX:+UseCGroupMemoryLimitForHeap` |
|
## ref: https://blogs.oracle.com/java-platform-group/java-se-support-for-docker-cpu-and-memory-limits |
|
## |
|
heapSize: "16g" |
And so this if condition is used:
|
{{- if .Values.graylog.heapSize }} |
|
value: "{{ $javaOpts }} {{ printf "-Xms%s -Xmx%s" .Values.graylog.heapSize .Values.graylog.heapSize}}" |
|
{{- else }} |
|
value: "{{ $javaOpts }} -XX:+UnlockExperimentalVMOptions -XX:+UseContainerSupport" |
|
{{- end }} |
We had to explicitly add heapSize to our values file:
In order to get Graylog to stop consuming so much memory.
By the way, love the chart, thank you for it! 🙏
In the documentation, it states:
So, we all incorrectly assumed this meant that if we do not specify a
graylog.heapSizein our values, it will default to ourresources.requests.memoryvalue, which we are specifying like so in our values file:To my surprise, I saw Graylog regularly consuming > 13GB of memory. It turns out, the documentation is incorrect, because
16gis hard-coded to the default values here:charts/charts/graylog/values.yaml
Lines 369 to 372 in 0c8a9a4
And so this if condition is used:
charts/charts/graylog/templates/statefulset.yaml
Lines 111 to 115 in 0c8a9a4
We had to explicitly add
heapSizeto our values file:In order to get Graylog to stop consuming so much memory.
By the way, love the chart, thank you for it! 🙏