Add force jmethodID experimental feature support#11549
Conversation
…dd-trace-java into zgu/experimental_reduce_jmethod
This comment has been minimized.
This comment has been minimized.
🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)
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.
Pull request overview
Adds an experimental profiling configuration flag to control ddprof’s “force jmethodID preloading” behavior, aiming to reduce native memory usage by allowing jmethodID preloading to be disabled for eligible classes while preserving current behavior by default.
Changes:
- Added a new profiling config key + default for
profiling.experimental.ddprof.force_jmethodID. - Wired the flag into ddprof start command generation (emit
fjmethodid=falsewhen disabled). - Exposed the flag in supported-config metadata and in the profiler flare configuration output.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| metadata/supported-configurations.json | Registers the new env var metadata entry for the experimental ddprof flag. |
| dd-trace-api/src/main/java/datadog/trace/api/config/ProfilingConfig.java | Introduces the public config constant and default value for the new flag. |
| dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerConfig.java | Adds a helper accessor to read the boolean config from ConfigProvider. |
| dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfiler.java | Appends the ddprof command option when the flag is set to disable forcing jmethodID preloading. |
| dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilerFlareReporter.java | Includes the new flag in flare-reported profiler configuration output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…dd-trace-java into zgu/experimental_reduce_jmethod
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
What Does This Do
This PR adds an experimental flag
profiling.experimental.ddprof.force_jmethodIDto enable ddprof feature that aims to reduce pre-loading jmethodIDs for system classes.The flag is off (true) by default to preserve current behavior.
Motivation
Preloading all jmethodIDs is proved to be a memory footprint issue. In an extreme case, it consumed 9GB native memory.
ddprof is experimenting a way to lessen dependency on jmethod IDs: none lambda and hidden classes that are loaded by system class loaders (bootstrap, platform and application class loaders), never unloaded. Instead of storing jmethod IDs for the methods of the classes, ddprof stores raw method pointers and resolves at dumping time. Therefore, ddprof does not preload jmethod IDs of none-lambda/hidden classes from those class loaders.
Additional Notes
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/merge. You can also:/merge --commit-message "..."/merge -c/merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-levelJira ticket: [PROJ-IDENT]