Skip to content

ci: raise ASan test JVM heap to fix flaky nightly OOMs#640

Merged
jbachorik merged 5 commits into
mainfrom
jb/fix-flaky-asan-nightly
Jul 8, 2026
Merged

ci: raise ASan test JVM heap to fix flaky nightly OOMs#640
jbachorik merged 5 commits into
mainfrom
jb/fix-flaky-asan-nightly

Conversation

@jbachorik

Copy link
Copy Markdown
Collaborator

What does this PR do?:

Raises the ASan test JVM's -Xmx from 512m to 1024m.

Motivation:

Nightly ASan runs have been flaky, repeatedly failing with Java heap space right at the forkEvery(25) restart boundary (e.g. runs on 2026-07-01, 07-02, 07-03, 07-07, 07-08). The 512m ceiling was sized only to keep the JVM's heap below ASan's shadow-memory region (0x7fff7000), but HeapBaseMinAddress=0x4000000 (64MB) leaves ~1.9GB of address space below that region — far more than 512m needs. Doubling the heap to 1024m still leaves comfortable headroom while giving the suite enough room to avoid OOMing on accumulated per-test allocations (JFR recordings, JMC object models) between forks.

Additional Notes:

No functional/runtime code changes — this only adjusts test JVM args in the Gradle build-logic convention plugin.

How to test the change?:

Can't be unit tested directly; validated by confirming the change compiles (./gradlew :build-logic:conventions:compileKotlin) and by observing the next several nightly ASan runs for the disappearance of the Java heap space failure.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a security review (run the dd:platform-security-review
    skill, or file a request via the PSEC review form).
    bewaire also runs automatically on every PR.
  • This PR doesn't touch any of that.
  • JIRA: [JIRA-XXXX]

Unsure? Have a question? Request a review!

Nightly asan runs repeatedly OOM with "Java heap space" at the
forkEvery(25) restart boundary. -Xmx512m was sized purely to avoid
colliding with ASan's shadow-memory region, but ~1.9GB of address
space actually separates the pinned heap base from that region.
@jbachorik jbachorik added AI test:asan Run CI tests with AddressSanitizer configuration labels Jul 8, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #28939986738 | Commit: 220544f | Duration: 17m 32s (longest job)

All 54 test jobs passed

Status Overview

JDK glibc-aarch64/asan glibc-aarch64/debug glibc-amd64/asan 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: 54 | Passed: 54 | Failed: 0


Updated: 2026-07-08 14:27:12 UTC

jbachorik added 2 commits July 8, 2026 12:23
The asan config now overrides -Xmx to 1024m; the test previously
hardcoded 512m for all configs.
Replaces the per-config hardcoded heap size with a value read from
RuntimeMXBean's input arguments, so the test doesn't need updating
whenever a test task's -Xmx changes.
Comment thread ddprof-test/src/test/java/com/datadoghq/profiler/JVMAccessTest.java Fixed
Comment thread ddprof-test/src/test/java/com/datadoghq/profiler/JVMAccessTest.java Fixed
Comment thread ddprof-test/src/test/java/com/datadoghq/profiler/JVMAccessTest.java Fixed
Comment thread ddprof-test/src/test/java/com/datadoghq/profiler/JVMAccessTest.java Fixed
…Exception'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@jbachorik jbachorik marked this pull request as ready for review July 8, 2026 11:03
@jbachorik jbachorik requested a review from a team as a code owner July 8, 2026 11:03

@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: 86ee933bbb

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ddprof-test/src/test/java/com/datadoghq/profiler/JVMAccessTest.java
Addresses PR review feedback: ASan configs append a config-specific
-Xmx after the standard one, and HotSpot honors the last duplicate.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Tests

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: d9456b3 | Docs | Datadog PR Page | Give us feedback!

@kaahos kaahos 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.

looks good to me, thanks for the changes!

@jbachorik jbachorik merged commit b030467 into main Jul 8, 2026
322 of 325 checks passed
@jbachorik jbachorik deleted the jb/fix-flaky-asan-nightly branch July 8, 2026 14:55
@github-actions github-actions Bot added this to the 1.47.0 milestone Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI test:asan Run CI tests with AddressSanitizer configuration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants