Skip to content

fix(codecache): report the real runtime-stubs cache size - #681

Merged
rkennke merged 4 commits into
mainfrom
fix/codecache-runtime-stubs-counter
Jul 24, 2026
Merged

fix(codecache): report the real runtime-stubs cache size#681
rkennke merged 4 commits into
mainfrom
fix/codecache-runtime-stubs-counter

Conversation

@rkennke

@rkennkerkennke commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What

Fixes CODECACHE_RUNTIME_STUBS_SIZE_BYTES to report the JIT runtime-stubs code cache, instead of duplicating the native-libraries size.

Why

The counter was set to native_libs.memoryUsage() — the same expression as CODECACHE_NATIVE_SIZE_BYTES on the line above — a copy-paste present since it was introduced (d0b0d1e44 "add counters for codecaches"). So it never reflected the runtime stubs; it just double-reported the native-libs total.

The runtime stubs are a separate cache: JitCodeCache::_runtime_stubs (name "[stubs]"), populated via JitCodeCache::DynamicCodeGenerated()add() as the JVM emits VM stubs. (There is also an unrelated, unused Libraries::_runtime_stubs member — same name, different thing; the live one is in JitCodeCache.)

How

  • Add JitCodeCache::runtimeStubsMemoryUsage(), which reads _runtime_stubs.memoryUsage() under _stubs_lock.lockShared(). That cache is mutated concurrently by the DynamicCodeGenerated JVMTI callback (add()/expand() under _stubs_lock), so the read must hold the shared lock — mirroring findRuntimeStub().
  • Set CODECACHE_RUNTIME_STUBS_SIZE_BYTES from it in Profiler::dump().

hotspot/jitCodeCache.* is compiled for all VM targets; on non-HotSpot VMs the callback never fires, so the cache is empty and the counter reports its (small, constant) empty-cache baseline rather than the wrong native-libs figure.

Notes

  • Scope: this PR fixes which cache the counter reflects (runtime stubs vs. the copy-pasted native-libs value). With fix(codecache): make memoryUsage() accurate and live #677 now merged, CodeCache::memoryUsage() is accurate, so this counter reports the real runtime-stubs footprint.
  • Rebased on latest main (which includes the merged fix(codecache): make memoryUsage() accurate and live #677 accuracy fix), so no duplicate accuracy work is needed here.
  • No unit test: _runtime_stubs is private and populated only by the JVMTI callback, so it can't be driven from gtest. Exercised by the JVM integration tests in CI (dump populates the counter).

Testing

  • :ddprof-lib:gtestDebug green — 349 tests, 0 failures.

🤖 Generated with Claude Code

CopilotAI review requested due to automatic review settings July 22, 2026 13:35

CopilotAI 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.

Pull request overview

Fixes the CODECACHE_RUNTIME_STUBS_SIZE_BYTES counter to report the HotSpot JIT runtime-stubs cache size (instead of incorrectly duplicating the native-libraries code cache size), improving the accuracy of codecache-related diagnostics emitted by Profiler::dump().

Changes:

  • Wire CODECACHE_RUNTIME_STUBS_SIZE_BYTES to JitCodeCache::_runtime_stubs.memoryUsage() instead of native_libs.memoryUsage().
  • Add JitCodeCache::runtimeStubsMemoryUsage() that reads under the shared stubs lock to avoid races with concurrent JVMTI DynamicCodeGenerated() updates.
  • Include the necessary hotspot/jitCodeCache.h dependency from profiler.cpp.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

FileDescription
ddprof-lib/src/main/cpp/profiler.cppSets CODECACHE_RUNTIME_STUBS_SIZE_BYTES from JitCodeCache::runtimeStubsMemoryUsage() instead of duplicating native libs size.
ddprof-lib/src/main/cpp/hotspot/jitCodeCache.hDeclares runtimeStubsMemoryUsage() with concurrency rationale.
ddprof-lib/src/main/cpp/hotspot/jitCodeCache.cppImplements runtimeStubsMemoryUsage() using _stubs_lock.lockShared() around _runtime_stubs.memoryUsage().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dd-octo-sts

dd-octo-stsBot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run:#30073266182 | Commit:ad97309 | Duration: 14m 54s (longest job)

All 32 test jobs passed

Status Overview

JDKglibc-aarch64/debugglibc-amd64/debugmusl-aarch64/debugmusl-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: 32 | Passed: 32 | Failed: 0


Updated: 2026-07-24 07:05:38 UTC

@dd-octo-sts

Copy link
Copy Markdown
Contributor

Benchmark Results (commit 8c422a3)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/126245147 Commit: 8c422a30432280584f389c4aa4427007f1385c03

✅ Within expected boundaries

No significant runtime deltas (all within run-to-run noise) and no internal-counter outliers.

Runtime details (per benchmark × JDK)
BenchmarkJDKLatestDevΔ (dev vs latest)Issues L/D
akka-uct21✅ 10332 ms (21 iters)✅ 10170 ms (21 iters)≈ -1.6% (±11.1%)— / —
akka-uct25✅ 8849 ms (24 iters)✅ 8865 ms (24 iters)≈ +0.2% (±11%)— / —
finagle-chirper21✅ 5998 ms (33 iters)✅ 5981 ms (33 iters)≈ -0.3% (±25.2%)⚠️ W:3 / ⚠️ W:3
fj-kmeans21✅ 2752 ms (68 iters)✅ 2686 ms (70 iters)≈ -2.4% (±2.7%)— / —
fj-kmeans25✅ 2818 ms (66 iters)✅ 2749 ms (69 iters)≈ -2.4% (±2.6%)— / —
future-genetic21✅ 2091 ms (88 iters)✅ 2073 ms (90 iters)≈ -0.9% (±2.6%)— / —
future-genetic25✅ 2064 ms (90 iters)✅ 2048 ms (91 iters)≈ -0.8% (±2.6%)— / —
naive-bayes21✅ 1257 ms (136 iters)✅ 1265 ms (135 iters)≈ +0.6% (±32.4%)— / —
naive-bayes25✅ 983 ms (173 iters)✅ 1014 ms (169 iters)≈ +3.2% (±32%)— / —
reactors21✅ 16352 ms (15 iters)✅ 16136 ms (15 iters)≈ -1.3% (±6.9%)— / —
reactors25✅ 18512 ms (15 iters)✅ 18450 ms (15 iters)≈ -0.3% (±5.8%)— / —
Internal counter details (ddprof)

ddprof internal counters, latest / dev (✅ = 0, · = unavailable):

BenchmarkJDKDropped recDropped jvmtiDropped traceSkipped WCAGCT failUnwind fail
akka-uct21✅ / ✅✅ / ✅1 / 21941 / 2072✅ / ✅✅ / ✅
akka-uct25✅ / ✅✅ / ✅✅ / 12346 / 2182✅ / ✅✅ / ✅
finagle-chirper21✅ / ✅✅ / ✅2 / 58580 / 8611✅ / ✅✅ / ✅
fj-kmeans21✅ / ✅✅ / ✅6 / 21262 / 1255✅ / ✅✅ / ✅
fj-kmeans25✅ / ✅✅ / ✅✅ / 21290 / 1308✅ / ✅✅ / ✅
future-genetic21✅ / ✅✅ / ✅✅ / ✅✅ / ✅✅ / ✅✅ / ✅
future-genetic25✅ / ✅✅ / ✅1 / ✅2870 / 2900✅ / ✅✅ / ✅
naive-bayes21✅ / ✅✅ / ✅3 / 33516 / 3537✅ / ✅✅ / ✅
naive-bayes25✅ / ✅✅ / ✅4 / 53421 / 3449✅ / ✅✅ / ✅
reactors21✅ / ✅✅ / ✅1 / 11627 / 1622✅ / ✅✅ / ✅
reactors25✅ / ✅✅ / ✅✅ / 11936 / 1909✅ / ✅✅ / ✅

@rkennke
rkennke marked this pull request as ready for review July 22, 2026 14:21
@rkennke
rkennke requested a review from a team as a code ownerJuly 22, 2026 14:22

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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:8c422a3043

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment threadddprof-lib/src/main/cpp/hotspot/jitCodeCache.h Outdated
@dd-octo-sts

dd-octo-stsBot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Reliability & Chaos Results

All reliability & chaos checks passed Pipeline: https://gitlab.ddbuild.io/DataDog/java-profiler/-/pipelines/126561737

@rkennke

Copy link
Copy Markdown
ContributorAuthor

Correct that the magnitude is still approximate here — but that's by design of the split, not something to fix in this PR:

  • This PR fixes which cache the counter reflects: CODECACHE_RUNTIME_STUBS_SIZE_BYTES was a copy-paste of native_libs.memoryUsage() and never pointed at the runtime-stubs cache at all. After this, it reads JitCodeCache::_runtime_stubs (under its lock).
  • The accuracy of memoryUsage() — the exact _capacity*sizeof(CodeBlob*) + _count*sizeof(NativeFunc) undercount you flagged — is fixed in fix(codecache): make memoryUsage() accurate and live #677, which rewrites CodeCache::memoryUsage() to count the real CodeBlob array + variable-length NativeFunc name allocations + DWARF table. That applies to everymemoryUsage()-based counter, including this one and CODECACHE_NATIVE_SIZE_BYTES.

So #681 + #677 together give an accurate runtime-stubs figure; keeping the accuracy fix in one place (#677) avoids duplicating/rebasing the same memoryUsage() change across PRs. Until #677 lands, this counter carries the same naive approximation as the sibling native_libs counter — no worse, and now at least attributed to the correct cache. I've made that explicit in the PR description.

@rkennke
rkennkeforce-pushed the fix/codecache-runtime-stubs-counter branch from 8c422a3 to bb2147fCompareJuly 22, 2026 14:58
CopilotAI review requested due to automatic review settings July 22, 2026 14:58

CopilotAI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment threadddprof-lib/src/main/cpp/hotspot/jitCodeCache.h Outdated
@rkennke

Copy link
Copy Markdown
ContributorAuthor

Reworded the comment to "approximate heap usage" (from "live heap footprint") and noted that CodeCache::memoryUsage() is a capacity/count estimate today, made exact by #677. Same underlying point as the codex P2 above — this PR fixes which cache the counter reflects; #677 fixes the magnitude.

CopilotAI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@datadog-datadog-prod-us1

This comment has been minimized.

@dd-octo-sts

Copy link
Copy Markdown
Contributor

Benchmark Results (commit 2886d41)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/126276523 Commit: 2886d411b833bf8b8e12ed533ac8b62139ea982b

⚠️ Significant outliers

  • 🔴 fj-kmeans (JDK 21): runtime +3.2% (2695→2780 ms)
Runtime details (per benchmark × JDK)
BenchmarkJDKLatestDevΔ (dev vs latest)Issues L/D
akka-uct21✅ 10301 ms (21 iters)✅ 10255 ms (21 iters)≈ -0.4% (±11.7%)— / —
akka-uct25✅ 8866 ms (24 iters)✅ 8851 ms (24 iters)≈ -0.2% (±10.2%)— / —
finagle-chirper21✅ 6010 ms (33 iters)✅ 5981 ms (33 iters)≈ -0.5% (±25%)⚠️ W:3 / ⚠️ W:3
finagle-chirper25✅ 5450 ms (36 iters)✅ 5463 ms (36 iters)≈ +0.2% (±24.9%)⚠️ W:3 / ⚠️ W:3
fj-kmeans21✅ 2695 ms (70 iters)✅ 2780 ms (67 iters)🔴 +3.2%— / —
fj-kmeans25✅ 2827 ms (66 iters)✅ 2809 ms (66 iters)≈ -0.6% (±2.6%)— / —
future-genetic25✅ 2115 ms (88 iters)✅ 2071 ms (90 iters)≈ -2.1% (±2.6%)— / —
naive-bayes21✅ 1322 ms (130 iters)✅ 1262 ms (136 iters)≈ -4.5% (±31.6%)— / —
naive-bayes25✅ 1020 ms (168 iters)✅ 999 ms (172 iters)≈ -2.1% (±31.3%)— / —
reactors21✅ 16568 ms (15 iters)✅ 17173 ms (15 iters)≈ +3.7% (±7.6%)— / —
reactors25✅ 18482 ms (15 iters)✅ 18271 ms (15 iters)≈ -1.1% (±5.5%)— / —
Internal counter details (ddprof)

ddprof internal counters, latest / dev (✅ = 0, · = unavailable):

BenchmarkJDKDropped recDropped jvmtiDropped traceSkipped WCAGCT failUnwind fail
akka-uct21✅ / ✅✅ / ✅2 / 11960 / 2005✅ / ✅✅ / ✅
akka-uct25✅ / ✅✅ / ✅3 / 32153 / 2334✅ / ✅✅ / ✅
finagle-chirper21✅ / ✅✅ / ✅2 / 18594 / 8571✅ / ✅✅ / ✅
finagle-chirper25✅ / ✅✅ / ✅1 / 18022 / 8344✅ / ✅✅ / ✅
fj-kmeans21✅ / ✅✅ / ✅✅ / 11273 / 1304✅ / ✅✅ / ✅
fj-kmeans25✅ / ✅✅ / ✅3 / ✅1278 / 1268✅ / ✅✅ / ✅
future-genetic25✅ / ✅✅ / ✅✅ / 32864 / 2825✅ / ✅✅ / ✅
naive-bayes21✅ / ✅✅ / ✅4 / 23542 / 3487✅ / ✅✅ / ✅
naive-bayes25✅ / ✅✅ / ✅2 / ✅3473 / 3500✅ / ✅✅ / ✅
reactors21✅ / ✅✅ / ✅✅ / ✅1574 / 1749✅ / ✅✅ / ✅
reactors25✅ / ✅✅ / ✅✅ / 21873 / 1701✅ / ✅✅ / ✅

CopilotAI review requested due to automatic review settings July 23, 2026 10:52
@rkennke
rkennkeforce-pushed the fix/codecache-runtime-stubs-counter branch from 2886d41 to fd1ca88CompareJuly 23, 2026 10:52

CopilotAI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

CopilotAI review requested due to automatic review settings July 23, 2026 11:01

CopilotAI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@dd-octo-sts

Copy link
Copy Markdown
Contributor

Benchmark Results (commit 0742b45)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/126484118 Commit: 0742b4542e099bf424fb63ecfc5a92414070c48c

⚠️ Significant outliers

  • 🔴 fj-kmeans (JDK 21): runtime +2.7% (2745→2819 ms)
Runtime details (per benchmark × JDK)
BenchmarkJDKLatestDevΔ (dev vs latest)Issues L/D
akka-uct21✅ 10297 ms (21 iters)✅ 10304 ms (21 iters)≈ +0.1% (±11.3%)— / —
akka-uct25✅ 8896 ms (24 iters)✅ 8921 ms (24 iters)≈ +0.3% (±9.7%)— / —
finagle-chirper21✅ 5944 ms (33 iters)✅ 6013 ms (33 iters)≈ +1.2% (±25.9%)⚠️ W:3 / ⚠️ W:4
finagle-chirper25✅ 5472 ms (36 iters)✅ 5453 ms (36 iters)≈ -0.3% (±24%)⚠️ W:3 / ⚠️ W:3
fj-kmeans21✅ 2745 ms (68 iters)✅ 2819 ms (66 iters)🔴 +2.7%— / —
fj-kmeans25✅ 2835 ms (66 iters)✅ 2833 ms (66 iters)≈ -0.1% (±2.6%)— / —
future-genetic21✅ 2087 ms (89 iters)✅ 2041 ms (90 iters)≈ -2.2% (±2.6%)— / —
future-genetic25✅ 2096 ms (88 iters)✅ 2071 ms (89 iters)≈ -1.2% (±2.6%)— / —
naive-bayes21✅ 1243 ms (137 iters)✅ 1281 ms (134 iters)≈ +3.1% (±33.1%)— / —
naive-bayes25✅ 1000 ms (171 iters)✅ 1007 ms (170 iters)≈ +0.7% (±31.4%)— / —
reactors21✅ 16383 ms (15 iters)✅ 15786 ms (15 iters)≈ -3.6% (±7.5%)— / —
Internal counter details (ddprof)

ddprof internal counters, latest / dev (✅ = 0, · = unavailable):

BenchmarkJDKDropped recDropped jvmtiDropped traceSkipped WCAGCT failUnwind fail
akka-uct21✅ / ✅✅ / ✅3 / 52019 / 2035✅ / ✅✅ / ✅
akka-uct25✅ / ✅✅ / ✅✅ / ✅2224 / 2122✅ / ✅✅ / ✅
finagle-chirper21✅ / ✅✅ / ✅2 / 38454 / 8884✅ / ✅✅ / ✅
finagle-chirper25✅ / ✅✅ / ✅2 / ✅8262 / 8260✅ / ✅✅ / ✅
fj-kmeans21✅ / ✅✅ / ✅1 / 11253 / 1246✅ / ✅✅ / ✅
fj-kmeans25✅ / ✅✅ / ✅✅ / ✅1279 / 1283✅ / ✅✅ / ✅
future-genetic21✅ / ✅✅ / ✅4 / 33028 / 2878✅ / ✅✅ / ✅
future-genetic25✅ / ✅✅ / ✅✅ / 22859 / 2838✅ / ✅✅ / ✅
naive-bayes21✅ / ✅✅ / ✅1 / 43497 / 3520✅ / ✅✅ / ✅
naive-bayes25✅ / ✅✅ / ✅3 / 23489 / 3438✅ / ✅✅ / ✅
reactors21✅ / ✅✅ / ✅2 / 11642 / 1682✅ / ✅✅ / ✅

Comment threadddprof-lib/src/main/cpp/profiler.cpp
@jbachorikjbachorik added the sphinx:spotcheck Sphinx: spot-check recommended label Jul 23, 2026
CopilotAI review requested due to automatic review settings July 23, 2026 14:05

CopilotAI 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.

Pull request overview

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

@dd-octo-sts

Copy link
Copy Markdown
Contributor

Benchmark Results (commit b80dfc4)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/126538514 Commit: b80dfc4a71f3df75be8d6fd44609a5a1b97a4850

✅ Within expected boundaries

No significant runtime deltas (all within run-to-run noise) and no internal-counter outliers.

Runtime details (per benchmark × JDK)
BenchmarkJDKLatestDevΔ (dev vs latest)Issues L/D
akka-uct21✅ 10257 ms (21 iters)✅ 10384 ms (21 iters)≈ +1.2% (±11.1%)— / —
akka-uct25✅ 8825 ms (24 iters)✅ 8765 ms (24 iters)≈ -0.7% (±9.8%)— / —
finagle-chirper21✅ 6033 ms (33 iters)✅ 6005 ms (33 iters)≈ -0.5% (±25.4%)⚠️ W:3 / ⚠️ W:3
finagle-chirper25✅ 5470 ms (36 iters)✅ 5436 ms (36 iters)≈ -0.6% (±24.2%)⚠️ W:3 / ⚠️ W:4
fj-kmeans21✅ 2756 ms (68 iters)✅ 2752 ms (68 iters)≈ -0.1% (±2.8%)— / —
fj-kmeans25✅ 2808 ms (66 iters)✅ 2792 ms (67 iters)≈ -0.6% (±2.6%)— / —
future-genetic21✅ 2083 ms (89 iters)✅ 2134 ms (88 iters)≈ +2.4% (±2.7%)— / —
future-genetic25✅ 2057 ms (91 iters)✅ 2078 ms (89 iters)≈ +1% (±2.6%)— / —
naive-bayes21✅ 1273 ms (134 iters)✅ 1253 ms (136 iters)≈ -1.6% (±32.3%)— / —
naive-bayes25✅ 1015 ms (168 iters)✅ 1014 ms (169 iters)≈ -0.1% (±31.8%)— / —
reactors21✅ 16117 ms (15 iters)✅ 15653 ms (16 iters)≈ -2.9% (±7.8%)— / —
reactors25✅ 18362 ms (15 iters)✅ 18219 ms (15 iters)≈ -0.8% (±4.4%)— / —
Internal counter details (ddprof)

ddprof internal counters, latest / dev (✅ = 0, · = unavailable):

BenchmarkJDKDropped recDropped jvmtiDropped traceSkipped WCAGCT failUnwind fail
akka-uct21✅ / ✅✅ / ✅2 / 31982 / 1981✅ / ✅✅ / ✅
akka-uct25✅ / ✅✅ / ✅3 / 22353 / 2386✅ / ✅✅ / ✅
finagle-chirper21✅ / ✅✅ / ✅5 / 28205 / 8643✅ / ✅✅ / ✅
finagle-chirper25✅ / ✅✅ / ✅1 / 28380 / 8111✅ / ✅✅ / ✅
fj-kmeans21✅ / ✅✅ / ✅1 / 11253 / 1260✅ / ✅✅ / ✅
fj-kmeans25✅ / ✅✅ / ✅5 / ✅1272 / 1279✅ / ✅✅ / ✅
future-genetic21✅ / ✅✅ / ✅1 / 33030 / 3007✅ / ✅✅ / ✅
future-genetic25✅ / ✅✅ / ✅1 / 42841 / 2834✅ / ✅✅ / ✅
naive-bayes21✅ / ✅✅ / ✅4 / 53510 / 3505✅ / ✅✅ / ✅
naive-bayes25✅ / ✅✅ / ✅2 / 33466 / 3500✅ / ✅✅ / ✅
reactors21✅ / ✅✅ / ✅✅ / 11570 / 1584✅ / ✅✅ / ✅
reactors25✅ / ✅✅ / ✅✅ / ✅1936 / 1868✅ / ✅✅ / ✅

CopilotAI review requested due to automatic review settings July 23, 2026 15:08

CopilotAI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dd-octo-sts

Copy link
Copy Markdown
Contributor

Benchmark Results (commit f6ee1ce)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/126561763 Commit: f6ee1ced5c7cb4921d8699e56402b87541a76cca

⚠️ Significant outliers

  • 🔴 future-genetic (JDK 21): runtime +4.4% (2071→2162 ms)
Runtime details (per benchmark × JDK)
BenchmarkJDKLatestDevΔ (dev vs latest)Issues L/D
akka-uct21✅ 10224 ms (21 iters)✅ 10278 ms (21 iters)≈ +0.5% (±12.1%)— / —
akka-uct25✅ 8834 ms (24 iters)✅ 8870 ms (24 iters)≈ +0.4% (±10%)— / —
finagle-chirper21✅ 6008 ms (33 iters)✅ 6014 ms (33 iters)≈ +0.1% (±24.7%)⚠️ W:3 / ⚠️ W:3
fj-kmeans21✅ 2771 ms (68 iters)✅ 2774 ms (68 iters)≈ +0.1% (±2.8%)— / —
fj-kmeans25✅ 2803 ms (66 iters)✅ 2837 ms (66 iters)≈ +1.2% (±2.6%)— / —
future-genetic21✅ 2071 ms (89 iters)✅ 2162 ms (86 iters)🔴 +4.4%— / —
naive-bayes21✅ 1241 ms (139 iters)✅ 1297 ms (133 iters)≈ +4.5% (±33%)— / —
naive-bayes25✅ 970 ms (176 iters)✅ 997 ms (171 iters)≈ +2.8% (±32%)— / —
reactors21✅ 15680 ms (15 iters)✅ 16453 ms (15 iters)≈ +4.9% (±7.7%)— / —
reactors25✅ 18106 ms (15 iters)✅ 18265 ms (15 iters)≈ +0.9% (±5.8%)— / —
Internal counter details (ddprof)

ddprof internal counters, latest / dev (✅ = 0, · = unavailable):

BenchmarkJDKDropped recDropped jvmtiDropped traceSkipped WCAGCT failUnwind fail
akka-uct21✅ / ✅✅ / ✅✅ / ✅✅ / ✅✅ / ✅✅ / ✅
akka-uct25✅ / ✅✅ / ✅3 / 22339 / 2394✅ / ✅✅ / ✅
finagle-chirper21✅ / ✅✅ / ✅2 / 58689 / 8640✅ / ✅✅ / ✅
fj-kmeans21✅ / ✅✅ / ✅3 / ✅1288 / 1264✅ / ✅✅ / ✅
fj-kmeans25✅ / ✅✅ / ✅4 / 11254 / 1290✅ / ✅✅ / ✅
future-genetic21✅ / ✅✅ / ✅1 / ✅3092 / 2993✅ / ✅✅ / ✅
naive-bayes21✅ / ✅✅ / ✅8 / 13576 / 3480✅ / ✅✅ / ✅
naive-bayes25✅ / ✅✅ / ✅6 / 23504 / 3472✅ / ✅✅ / ✅
reactors21✅ / ✅✅ / ✅1 / 11552 / 1675✅ / ✅✅ / ✅
reactors25✅ / ✅✅ / ✅4 / 21814 / 1744✅ / ✅✅ / ✅

rkennkeand others added 4 commits July 24, 2026 08:43
CODECACHE_RUNTIME_STUBS_SIZE_BYTES was set to native_libs.memoryUsage() —
the same value as CODECACHE_NATIVE_SIZE_BYTES — a copy-paste since the
counter was introduced (d0b0d1e). It never reflected the runtime-stubs
cache.
The runtime stubs live in JitCodeCache::_runtime_stubs (populated by
DynamicCodeGenerated as the JVM emits stubs), a different cache from the
native libraries. Add JitCodeCache::runtimeStubsMemoryUsage(), which reads
that cache's size under its shared _stubs_lock (the cache is mutated
concurrently by the JVMTI callback), and set the counter from it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ootprint"
CodeCache::memoryUsage() is a capacity/count-based estimate on main, so
"live heap footprint" overstated it. Reword to "approximate heap usage"
and note #677 makes memoryUsage() exact.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…age is exact
With #677 merged, CodeCache::memoryUsage() is accurate on main, so the
runtime-stubs accessor comment describing it as an approximation (pending
#677) is no longer true. Describe current behavior.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The runtime-stubs memory counter called the HotSpot-specific
JitCodeCache::runtimeStubsMemoryUsage() directly from shared
profiler.cpp, with no VM guard. On J9/Zing that reports a fixed
near-zero baseline with nothing in the code marking the value as
meaningless there.
Route it through the same JVMSupport -> HotspotSupport abstraction the
sibling isJitCode() accessor uses: JVMSupport::runtimeStubsMemoryUsage()
dispatches to HotspotSupport (-> JitCodeCache) on HotSpot and returns 0
elsewhere. profiler.cpp no longer references JitCodeCache directly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings July 24, 2026 06:46
@rkennke
rkennkeforce-pushed the fix/codecache-runtime-stubs-counter branch from f6ee1ce to df34493CompareJuly 24, 2026 06:46

CopilotAI 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.

Pull request overview

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

@dd-octo-sts

Copy link
Copy Markdown
Contributor

Benchmark Results (commit df34493)

Pipeline: https://gitlab.ddbuild.io/DataDog/apm-reliability/benchmarking-platform/-/pipelines/126711785 Commit: df34493a9499f571fdee30235b6bc1a9c831a31a

⚠️ Significant outliers

  • 🟢 future-genetic (JDK 25): runtime -2.7% (2090→2033 ms)
Runtime details (per benchmark × JDK)
BenchmarkJDKLatestDevΔ (dev vs latest)Issues L/D
akka-uct21✅ 10393 ms (21 iters)✅ 10316 ms (21 iters)≈ -0.7% (±11.5%)— / —
akka-uct25✅ 8979 ms (24 iters)✅ 8961 ms (24 iters)≈ -0.2% (±10.5%)— / —
finagle-chirper21✅ 5990 ms (33 iters)✅ 5949 ms (33 iters)≈ -0.7% (±25.3%)⚠️ W:3 / ⚠️ W:3
finagle-chirper25✅ 5461 ms (36 iters)✅ 5455 ms (36 iters)≈ -0.1% (±24.2%)⚠️ W:3 / ⚠️ W:3
fj-kmeans21✅ 2695 ms (70 iters)✅ 2724 ms (68 iters)≈ +1.1% (±2.7%)— / —
fj-kmeans25✅ 2810 ms (67 iters)✅ 2807 ms (67 iters)≈ -0.1% (±2.6%)— / —
future-genetic21✅ 2052 ms (90 iters)✅ 2072 ms (89 iters)≈ +1% (±2.6%)— / —
future-genetic25✅ 2090 ms (89 iters)✅ 2033 ms (91 iters)🟢 -2.7%— / —
naive-bayes21✅ 1304 ms (131 iters)✅ 1260 ms (136 iters)≈ -3.4% (±32.1%)— / —
naive-bayes25✅ 1015 ms (168 iters)✅ 1018 ms (168 iters)≈ +0.3% (±32.1%)— / —
reactors21✅ 16064 ms (15 iters)✅ 15890 ms (15 iters)≈ -1.1% (±7.4%)— / —
reactors25✅ 18184 ms (15 iters)✅ 18546 ms (15 iters)≈ +2% (±5.3%)— / —
Internal counter details (ddprof)

ddprof internal counters, latest / dev (✅ = 0, · = unavailable):

BenchmarkJDKDropped recDropped jvmtiDropped traceSkipped WCAGCT failUnwind fail
akka-uct21✅ / ✅✅ / ✅4 / 12023 / 2013✅ / ✅✅ / ✅
akka-uct25✅ / ✅✅ / ✅1 / 62391 / 2139✅ / ✅✅ / ✅
finagle-chirper21✅ / ✅✅ / ✅3 / 78405 / 8109✅ / ✅✅ / ✅
finagle-chirper25✅ / ✅✅ / ✅1 / 18605 / 8190✅ / ✅✅ / ✅
fj-kmeans21✅ / ✅✅ / ✅5 / ✅1295 / 1250✅ / ✅✅ / ✅
fj-kmeans25✅ / ✅✅ / ✅2 / 31317 / 1312✅ / ✅✅ / ✅
future-genetic21✅ / ✅✅ / ✅2 / 32958 / 2969✅ / ✅✅ / ✅
future-genetic25✅ / ✅✅ / ✅✅ / 32910 / 2893✅ / ✅✅ / ✅
naive-bayes21✅ / ✅✅ / ✅3 / 23483 / 3497✅ / ✅✅ / ✅
naive-bayes25✅ / ✅✅ / ✅3 / 43422 / 3502✅ / ✅✅ / ✅
reactors21✅ / ✅✅ / ✅2 / ✅1640 / 1556✅ / ✅✅ / ✅
reactors25✅ / ✅✅ / ✅✅ / ✅1778 / 1933✅ / ✅✅ / ✅

@rkennke
rkennke requested a review from jbachorikJuly 24, 2026 08:47

@jbachorikjbachorik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM!

@rkennke
rkennke merged commit c57ba18 into mainJul 24, 2026
106 checks passed
@rkennke
rkennke deleted the fix/codecache-runtime-stubs-counter branch July 24, 2026 09:19
@github-actionsgithub-actionsBot added this to the 1.48.0 milestone Jul 24, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sphinx:spotcheckSphinx: spot-check recommended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@rkennke@jbachorik