Skip to content

Add force jmethodID experimental feature support#11549

Draft
zhengyu123 wants to merge 14 commits into
masterfrom
zgu/experimental_reduce_jmethod
Draft

Add force jmethodID experimental feature support#11549
zhengyu123 wants to merge 14 commits into
masterfrom
zgu/experimental_reduce_jmethod

Conversation

@zhengyu123

@zhengyu123 zhengyu123 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

This PR adds an experimental flag profiling.experimental.ddprof.force_jmethodID to 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

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level
    • Get more information in this doc

Jira ticket: [PROJ-IDENT]

@zhengyu123 zhengyu123 added type: feature Enhancements and improvements comp: profiling Profiling labels Jun 3, 2026
@datadog-prod-us1-3

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🟡 Java Benchmark SLOs — Performance SLO warning (near threshold)

Suite Status
Startup 🟡 warning

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.81 s 14.68 s [-0.1%; +1.8%] (no difference)
startup:insecure-bank:tracing:Agent 13.63 s 13.70 s [-1.2%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 16.93 s 16.81 s [-0.3%; +1.7%] (no difference)
startup:petclinic:iast:Agent 16.75 s 16.99 s [-2.2%; -0.6%] (maybe better)
startup:petclinic:profiling:Agent 16.72 s 16.86 s [-2.0%; +0.4%] (no difference)
startup:petclinic:sca:Agent 16.85 s 16.69 s [+0.1%; +2.0%] (maybe worse)
startup:petclinic:tracing:Agent 15.63 s 16.11 s [-7.1%; +1.1%] (no difference)

Commit: 94654d01 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Copilot AI 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.

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=false when 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.

Comment thread dd-trace-api/src/main/java/datadog/trace/api/config/ProfilingConfig.java Outdated
Comment thread metadata/supported-configurations.json Outdated
zhengyu123 and others added 3 commits July 6, 2026 21:47
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…dd-trace-java into zgu/experimental_reduce_jmethod

Copilot AI 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.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

zhengyu123 and others added 4 commits July 6, 2026 22:39
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: profiling Profiling type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants