Add experimental config for ddprof native memory profiling - #12132
Add experimental config for ddprof native memory profiling#12132jbachorik wants to merge 8 commits into
Conversation
Wires dd.profiling.experimental.ddprof.nativemem.{enabled,interval} to the
ddprof nativemem= start argument, gated behind a new NATIVEMEM ProfilingMode.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Bits has a CI fix ready🟢 Investigated · 🟢 Fix prepared · ⚪ Validation skipped · 🟠 Ready
View in Datadog | Reviewed commit 3f9700e · Any feedback? Reach out in #deveng-pr-agent |
This comment has been minimized.
This comment has been minimized.
CI proxy config sets JAVA_TOOL_OPTIONS, which the JVM echoes to stderr on every launch, causing a false-positive module-load-failure error. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
There was a problem hiding this comment.
More details
The new native-memory mode is isolated behind an off-by-default flag, emits the configured nativemem interval, and remains safe in the existing profiling-mode consumers. No diff-only behavioral regression was identified; full tests were blocked because the pinned build requires an unavailable Java 25 toolchain and the wrapper distribution could not be downloaded.
🤖 Datadog Autotest · Commit 0105ac2 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
| // The JVM prints this diagnostic line to stderr whenever JAVA_TOOL_OPTIONS is set in the | ||
| // environment (e.g. CI proxy configuration) — it is not a module load failure. | ||
| def stderr = capturedError.toString().readLines() | ||
| .findAll { !it.startsWith('Picked up JAVA_TOOL_OPTIONS:') } |
There was a problem hiding this comment.
❔ question: How is that possible with the JAVA_TOOL_OPTIONS cleared from env few lines above?
There was a problem hiding this comment.
That location just removes the inherited JAVA_TOOL_OPTIONS - but it gets injected for the new process automatically in the CI runner images. There is nothing we can do not to have that env variable set 🤷
There was a problem hiding this comment.
I had claude analyze and made a reproducer. The fix from #12103 should have fixed it and raised the failure from your branch was before the merge to master. Can you check it's still needed for CI to pass?
cc @sarahchen6 as original fix author
There was a problem hiding this comment.
The build step passes without it :)
Okay, the rest on the CI looks like a 🎄 but… at least it shows the filter is not needed
There was a problem hiding this comment.
Yeah, infra does not have a good day. But yay, the workaround is not needed!
PerfectSlayer
left a comment
There was a problem hiding this comment.
Looking good. Thanks for the follow up change related to JAVA_TOOL_OPTIONS
What Does This Do
Adds experimental configuration to enable native memory (malloc) allocation tracking in the Datadog profiler (ddprof), and wires it into the native profiler's
nativemem=<interval>start argument.dd.profiling.experimental.ddprof.nativemem.enabled(defaultfalse)dd.profiling.experimental.ddprof.nativemem.interval(default524288bytes)A new
NATIVEMEMProfilingModegates the feature, following the same pattern as the existingALLOCATION/MEMLEAKmodes.Motivation
Native memory allocation tracking is a new capability in ddprof-lib. This exposes it behind an experimental, off-by-default config flag for internal testing.
Additional Notes
No new external dependencies. Feature is disabled by default.
Also fixes a CI false positive in
verifyAgentJarIntegrations: the task failed the build whenever any stderr was produced, but the JVM always echoesPicked up JAVA_TOOL_OPTIONS: ...to stderr when that env var is set (e.g. GitLab CI's proxy config), unrelated to actual module load failures. That line is now filtered out before the check.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issue