Skip to content

Documentation on heapSize is incorrect #166

@JVMartin

Description

@JVMartin

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:

heapSize: "7g"

In order to get Graylog to stop consuming so much memory.

By the way, love the chart, thank you for it! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions