Skip to content

Fix SanityCheckTest OOM on JDK 8 and a false crash in flake_report - #815

Merged
rkennke merged 3 commits into
mainfrom
fix/sanity-test-jdk8-footprint
Sep 24, 2026
Merged

rkennke merged 3 commits into
mainfrom
fix/sanity-test-jdk8-footprint

Conversation

@rkennke

@rkennke rkennke commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Two fixes found while getting the EL7 functional job (#805, #810) green.

SanityCheckTest forked a JVM that OOM-killed 6GB containers on JDK 8

mem_sanity_check_failure_is_recorded_in_jfr forks a JVM with -XX:+UseG1GC -Xmx900g so the memory sanity check fails. The check only reads flags, but JDK 8's G1 allocates and clears card-granularity bitmaps spanning the whole reserved heap, one per parallel GC thread. Peak cgroup memory of that fork, measured on Temurin 8u504 in an EL7 container:

JVM Peak
JDK 8, -Xmx8g ~150 MB
JDK 8, -Xmx900g, 1 GC thread 586 MB
JDK 8, -Xmx900g, 4 GC threads 1264 MB
JDK 8, -Xmx900g, 16 GC threads 3975 MB
JDK 11, -Xmx900g, any thread count ~140 MB

On the 6GB EL7 pod this OOM-killed the whole job mid-suite.

The check compares its estimate (at least 1.3 × -Xmx) against the smaller of MemTotal and the container memory limit. So -Xmx now comes from that same bound plus 1g: about 7g on a 6GB pod on a ~380GB node. The fork also gets -XX:ParallelGCThreads=1, which bounds the remaining cost where the bound is large. The check still fails deterministically.

flake_report.py read the -XX:ErrorFile template as a JVM crash

The crash marker matched any hs_err_pid. Gradle --info prints each test JVM's command line, including -XX:ErrorFile=build/hs_err_pid%p.log. Every run with --info was therefore classified as cut short, and its quarantined failures still gated the job. The marker now requires an actual pid (hs_err_pid\d+), which is how a real crash report names its file.

Test plan

  • test_quarantine.sh: new case for the -XX:ErrorFile template; it fails before the fix and passes after. All 60 cases pass, the other CI script test suites pass, and quarantine.py validate passes.
  • Memory-bound helper checked in an EL7 container: 6144 MB under a 6GB limit, falls back to MemTotal without one.
  • The same changes on ci: wire the EL7 functional job into #777's quarantine machinery #810: the EL7 JDK 8 functional job now completes. The sanity check reports 9896 MB against 6144 MB available, instead of 1198675 MB. All failures are quarantined, and the job succeeds on the default memory limit.
  • CI on this PR.

🤖 Generated with Claude Code

rkennke and others added 3 commits September 23, 2026 16:01
On JDK 8, G1 allocates and clears card-granularity bitmaps spanning the
whole reserved heap, one per parallel GC thread. With -Xmx900g the forked
JVM touches ~225MB per ParallelGCThreads on top of a ~360MB base (1.3GB at
4 threads, 4GB at 16, measured on 8u504), enough to OOM-kill a 6GB CI
container. JDK 11 stays around 140MB regardless.

The check only compares its heap-based estimate against MemTotal (or a
smaller container limit), so -Xmx just past MemTotal fails it just as
deterministically. A single GC thread bounds the remaining per-thread cost
on hosts with a lot of RAM.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The memory sanity check compares its estimate against the smaller of
MemTotal and the container memory limit. On a Kubernetes node MemTotal is
the whole host (~380GB on the EL7 runner) while the pod is limited to
6GB, so sizing -Xmx from MemTotal alone still forked a ~383g JVM. Take the
cgroup namespace's root limit into account too; the native check takes
the minimum over the process's whole cgroup ancestry, which includes that
root, so -Xmx just past this bound still always trips the check.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Gradle --info prints each test JVM's full command line, including
-XX:ErrorFile=build/hs_err_pid%p.log. The crash marker matched any
"hs_err_pid", so every EL7 functional run (the only cell running with
--info) was classified as cut short and its quarantined failures gated
the job. A real crash report names the file with an actual pid, so match
hs_err_pid followed by digits.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rkennke
rkennke requested a review from a team as a code owner September 23, 2026 15:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52497b051b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .github/scripts/flake_report.py
@dd-octo-sts

dd-octo-sts Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #35912535325 | Commit: 4784342 | Duration: 51m 48s (longest job)

All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - - -
8-ibm - - -
8-j9 - -
8-librca - -
8-orcl - - -
11 - - -
11-j9 - -
11-librca - -
17 - -
17-graal - -
17-j9 - -
17-librca - -
21 - -
21-graal - -
21-librca - -
25 - -
25-graal - -
25-librca - -

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-09-23 20:51:50 UTC

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Autotest was unable to complete this review. View session

Please try again by commenting @autotest review.

@dd-octo-sts

dd-octo-sts Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

All 40 integration tests passed

📊 Dashboard · 👷 Pipeline · 📦 52497b05

@rkennke rkennke added the sphinx:spotcheck Sphinx: spot-check recommended label Sep 23, 2026
@rkennke
rkennke merged commit 904963b into main Sep 24, 2026
191 of 192 checks passed
@rkennke
rkennke deleted the fix/sanity-test-jdk8-footprint branch September 24, 2026 08:03
@github-actions github-actions Bot added this to the 1.51.0 milestone Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sphinx:spotcheck Sphinx: spot-check recommended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant