Skip to content

Add force jmethodID experimental feature support#11549

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 20 commits into
masterfrom
zgu/experimental_reduce_jmethod
Jul 7, 2026
Merged

Add force jmethodID experimental feature support#11549
gh-worker-dd-mergequeue-cf854d[bot] merged 20 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.jmethodid_optim.enabled to enable ddprof feature that aims to reduce pre-loading jmethodIDs for system classes.

The flag is off (false) 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

datadog-prod-us1-3 Bot commented Jun 3, 2026

Copy link
Copy Markdown

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 56.92% (-0.01%)

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

@dd-octo-sts

dd-octo-sts Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

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 13.98 s 13.92 s [-0.3%; +1.2%] (no difference)
startup:insecure-bank:tracing:Agent 12.90 s 12.97 s [-1.2%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 16.80 s 16.76 s [-0.8%; +1.2%] (no difference)
startup:petclinic:iast:Agent 16.89 s 16.94 s [-1.2%; +0.6%] (no difference)
startup:petclinic:profiling:Agent 16.52 s 16.85 s [-3.2%; -0.8%] (maybe better)
startup:petclinic:sca:Agent 16.98 s 16.79 s [+0.1%; +2.1%] (maybe worse)
startup:petclinic:tracing:Agent 16.13 s 15.58 s [-0.9%; +7.9%] (no difference)

Commit: b61ddef2 · 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 <[email protected]>
…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.

Comment thread dd-trace-api/src/main/java/datadog/trace/api/config/ProfilingConfig.java Outdated
@zhengyu123
zhengyu123 marked this pull request as ready for review July 7, 2026 11:09
@zhengyu123
zhengyu123 requested review from a team as code owners July 7, 2026 11:09
@zhengyu123
zhengyu123 requested review from amarziali and removed request for a team July 7, 2026 11:09
@dd-octo-sts dd-octo-sts Bot added the tag: ai generated Largely based on code generated by an AI or LLM label Jul 7, 2026
@zhengyu123
zhengyu123 requested a review from jbachorik July 7, 2026 11:10

@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: 94654d016e

ℹ️ 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 dd-trace-api/src/main/java/datadog/trace/api/config/ProfilingConfig.java Outdated

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

Looking good. Thanks!

@zhengyu123
zhengyu123 added this pull request to the merge queue Jul 7, 2026
@dd-octo-sts

dd-octo-sts Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 7, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-07 17:25:43 UTC ℹ️ Start processing command /merge


2026-07-07 17:25:48 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-07-07 18:24:33 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 7, 2026
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit f767846 into master Jul 7, 2026
785 of 787 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the zgu/experimental_reduce_jmethod branch July 7, 2026 18:24
@github-actions github-actions Bot added this to the 1.64.0 milestone Jul 7, 2026
kaahos pushed a commit that referenced this pull request Jul 8, 2026
Added force jmethodID experimental feature support

Fix

Merge branch 'zgu/experimental_reduce_jmethod' of github.com:DataDog/dd-trace-java into zgu/experimental_reduce_jmethod

Add DD_PROFILING_EXPERIMENTAL_DDPROF_FORCE_JMETHODID to supported-configurations.json

Fix

Merge branch 'master' into zgu/experimental_reduce_jmethod

Merge branch 'master' into zgu/experimental_reduce_jmethod

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

AI reviews

Merge branch 'zgu/experimental_reduce_jmethod' of github.com:DataDog/dd-trace-java into zgu/experimental_reduce_jmethod

Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <[email protected]>

AI review comment

Fix config-inversion-linter failure

Fix checkConfigStrings

Merge branch 'master' into zgu/experimental_reduce_jmethod

Merge branch 'master' into zgu/experimental_reduce_jmethod

Addressed review comments

Create tmp file for recording

Fix

Replacing Path.of() due to language level

Co-authored-by: jbachorik <[email protected]>
Co-authored-by: devflow.devflow-routing-intake <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: profiling Profiling tag: ai generated Largely based on code generated by an AI or LLM type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants