Skip to content

fix(test): forkEvery for asan Test task to bound cumulative heap growth - #632

Merged
rkennke merged 1 commit into
mainfrom
fix/asan-testAsan-forkevery-oom
Jul 3, 2026
Merged

rkennke merged 1 commit into
mainfrom
fix/asan-testAsan-forkevery-oom

Conversation

@rkennke

@rkennke rkennke commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • test-linux-glibc-aarch64 (25, asan) failed with Java heap space in run https://github.com/DataDog/java-profiler/actions/runs/28658114523/job/85000253879, even though every individual test in the run passed.
  • Root cause: ddprof-test:testAsan has no forkEvery, so Gradle reuses a single forked JVM for the entire ~100+ class suite. That JVM is pinned to -Xmx512m (see ConfigurationPresets.kt) to keep the heap below ASan's shadow-memory mapping, an ASLR workaround that can't simply be raised. Per-test allocations (JFR recordings, JMC object models) accumulate across the whole suite until the shared heap runs out, even though no single test is at fault — a similar single-test instance of this was just fixed in fix(test): reduce ASAN wall-clock rate in BoundMethodHandleProfilerTest to avoid OOM #630 for BoundMethodHandleProfilerTest, but this run already included that fix and still OOM'd later in the suite.
  • Set forkEvery(25) on the asan Test task so the JVM restarts periodically and cumulative heap growth is bounded.

Test plan

  • Re-run pre-release-tests / test-linux-glibc-aarch64 (25, asan) in CI and confirm it completes without the Java heap space failure.
  • Spot-check that other asan test tasks (x86_64) still pass with the added JVM restarts.

🤖 Generated with Claude Code

The ASAN test JVM is pinned to -Xmx512m to keep the heap below ASan's
shadow-memory region (ASLR constraint). Without forkEvery, Gradle
reuses a single JVM for the entire ddprof-test:testAsan suite, and
per-test allocations (JFR recordings, JMC object models) accumulate
across ~100+ test classes until the shared heap OOMs late in the run,
even though every individual test passes. Restart the JVM every 25
classes to bound cumulative growth.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@rkennke
rkennke requested a review from a team as a code owner July 3, 2026 12:51
@rkennke rkennke added the trivial label Jul 3, 2026
@rkennke
rkennke merged commit 6f9b6c9 into main Jul 3, 2026
17 of 26 checks passed
@rkennke
rkennke deleted the fix/asan-testAsan-forkevery-oom branch July 3, 2026 12:52
@github-actions github-actions Bot added this to the 1.46.0 milestone Jul 3, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #34249245579 | Commit: 6f9b6c9 | Duration: 0s (longest job)

✅ All 0 test jobs passed

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


Updated: 2026-09-08 16:35:31 UTC

@zhengyu123 zhengyu123 added the fixed_version: v_1.46.0 Version this PR's fix shipped in label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fixed_version: v_1.46.0 Version this PR's fix shipped in trivial

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants