Skip to content

[fix] Adapt default FE JVM heaps to container memory limits - #552

Merged
morningman merged 2 commits into
apache:masterfrom
Al-assad:fix/fe-heap-memory-limit
Nov 18, 2026
Merged

morningman merged 2 commits into
apache:masterfrom
Al-assad:fix/fe-heap-memory-limit

Conversation

@Al-assad

@Al-assad Al-assad commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

What problem does this PR solve?

Issue Number: DORIS-30261

The default FE image can start with an 8 GiB heap even when the container memory limit is 8 GiB or less. For new DCR and DDC clusters with a memory limit, adapt the image defaults before startup. For both JDK 8 and JDK 17, set the initial and maximum heaps to 80% of the limit. JDK 8 uses fixed heap sizes rounded down to whole MiB. JDK 17 uses JVM container-aware percentages.

Keep explicit user JVM entries and the rest of the image's JVM options. A CR annotation preserves legacy behavior on Operator upgrades and lets users opt in during a planned rollout. The same-image init container stages the config before runtime config persistence.

Release note

New FE workloads with a memory limit default to 80% of that limit for both initial and maximum JVM heap sizes. Existing clusters can opt in with the doris.apache.org/fe-heap-policy=auto annotation.

Check List (For Author)

  • Test
    • Regression test
    • Unit Test
    • Manual test
  • Behavior changed
    • Yes. New eligible FE workloads adapt image defaults to the memory limit.
  • Does this need documentation?
    • Yes. See doc/operation/fe_heap.md.

Validation of the 80% policy:

  • The full Go suite passed with Kubernetes 1.31 envtest. Targeted race tests passed for FE heap sizing and runtime config persistence.
  • Regression tests verify JDK 8 emits matching initial and maximum heap sizes, including -Xms6553m -Xmx6553m for an 8 GiB limit. They also check that JDK 17 replaces the fixed image heap flags with the two 80% flags.
  • Ran the Doris 4.1.5 JDK 17 binary in an OrbStack container with an 8 GiB limit. Both effective heap flags were 6,874,464,256 bytes (about 6.4 GiB).

The preceding OrbStack K3s integration run covered official JDK 8 and 17 FE startup across DCR and DDC, ConfigMap precedence, request-only behavior, and upgrade compatibility. The FE Pod UID and StatefulSet template stayed the same on upgrade and the FE rolled after explicit opt-in. That run used the earlier heap ratios.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@morningman
morningman merged commit c02fe92 into apache:master Nov 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants