Enable live heap profiling by default on safe JVM versions#11039
Enable live heap profiling by default on safe JVM versions#11039gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits intomasterfrom
Conversation
0ac4316 to
ca7960a
Compare
Adds unified config key `profiling.liveheap.enabled` that auto-detects safe systems (isJmethodIDSafe || isOldObjectSampleAvailable) and enables live heap profiling by default. Ddprof native library is preferred with JFR OldObjectSample as fallback. New `profiling.liveheap.jfr.enabled` replaces deprecated `profiling.heap.enabled` with context-aware deprecation warnings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ca7960a to
868c547
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
The merge request has been interrupted because the build 106243977 took longer than expected. The current limit for the base branch 'master' is 120 minutes. |
BenchmarksStartupParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 58 metrics, 13 unstable metrics. Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.61.0-SNAPSHOT~3cb87b4db3, baseline=1.61.0-SNAPSHOT~4fa94c4f4f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.066 s) : 0, 1066283
Total [baseline] (11.048 s) : 0, 11048234
Agent [candidate] (1.058 s) : 0, 1058229
Total [candidate] (11.031 s) : 0, 11030942
section appsec
Agent [baseline] (1.252 s) : 0, 1251767
Total [baseline] (11.11 s) : 0, 11109870
Agent [candidate] (1.25 s) : 0, 1250105
Total [candidate] (11.107 s) : 0, 11106650
section iast
Agent [baseline] (1.237 s) : 0, 1236632
Total [baseline] (11.289 s) : 0, 11289461
Agent [candidate] (1.222 s) : 0, 1221925
Total [candidate] (11.278 s) : 0, 11278137
section profiling
Agent [baseline] (1.181 s) : 0, 1180709
Total [baseline] (11.054 s) : 0, 11053891
Agent [candidate] (1.184 s) : 0, 1184177
Total [candidate] (11.176 s) : 0, 11175521
gantt
title petclinic - break down per module: candidate=1.61.0-SNAPSHOT~3cb87b4db3, baseline=1.61.0-SNAPSHOT~4fa94c4f4f
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.244 ms) : 0, 1244
crashtracking [candidate] (1.215 ms) : 0, 1215
BytebuddyAgent [baseline] (636.574 ms) : 0, 636574
BytebuddyAgent [candidate] (632.888 ms) : 0, 632888
AgentMeter [baseline] (29.554 ms) : 0, 29554
AgentMeter [candidate] (29.2 ms) : 0, 29200
GlobalTracer [baseline] (250.204 ms) : 0, 250204
GlobalTracer [candidate] (249.96 ms) : 0, 249960
AppSec [baseline] (32.241 ms) : 0, 32241
AppSec [candidate] (32.329 ms) : 0, 32329
Debugger [baseline] (60.18 ms) : 0, 60180
Debugger [candidate] (60.239 ms) : 0, 60239
Remote Config [baseline] (598.587 µs) : 0, 599
Remote Config [candidate] (607.951 µs) : 0, 608
Telemetry [baseline] (8.162 ms) : 0, 8162
Telemetry [candidate] (8.25 ms) : 0, 8250
Flare Poller [baseline] (11.299 ms) : 0, 11299
Flare Poller [candidate] (7.442 ms) : 0, 7442
section appsec
crashtracking [baseline] (1.221 ms) : 0, 1221
crashtracking [candidate] (1.238 ms) : 0, 1238
BytebuddyAgent [baseline] (665.003 ms) : 0, 665003
BytebuddyAgent [candidate] (663.154 ms) : 0, 663154
AgentMeter [baseline] (12.124 ms) : 0, 12124
AgentMeter [candidate] (12.034 ms) : 0, 12034
GlobalTracer [baseline] (249.892 ms) : 0, 249892
GlobalTracer [candidate] (249.701 ms) : 0, 249701
AppSec [baseline] (183.821 ms) : 0, 183821
AppSec [candidate] (184.296 ms) : 0, 184296
Debugger [baseline] (65.981 ms) : 0, 65981
Debugger [candidate] (66.015 ms) : 0, 66015
Remote Config [baseline] (592.892 µs) : 0, 593
Remote Config [candidate] (604.656 µs) : 0, 605
Telemetry [baseline] (8.563 ms) : 0, 8563
Telemetry [candidate] (8.618 ms) : 0, 8618
Flare Poller [baseline] (3.54 ms) : 0, 3540
Flare Poller [candidate] (3.572 ms) : 0, 3572
IAST [baseline] (24.598 ms) : 0, 24598
IAST [candidate] (24.558 ms) : 0, 24558
section iast
crashtracking [baseline] (1.245 ms) : 0, 1245
crashtracking [candidate] (1.215 ms) : 0, 1215
BytebuddyAgent [baseline] (810.428 ms) : 0, 810428
BytebuddyAgent [candidate] (799.36 ms) : 0, 799360
AgentMeter [baseline] (11.742 ms) : 0, 11742
AgentMeter [candidate] (11.345 ms) : 0, 11345
GlobalTracer [baseline] (241.269 ms) : 0, 241269
GlobalTracer [candidate] (238.78 ms) : 0, 238780
AppSec [baseline] (31.123 ms) : 0, 31123
AppSec [candidate] (30.13 ms) : 0, 30130
Debugger [baseline] (61.738 ms) : 0, 61738
Debugger [candidate] (64.074 ms) : 0, 64074
Remote Config [baseline] (1.137 ms) : 0, 1137
Remote Config [candidate] (1.701 ms) : 0, 1701
Telemetry [baseline] (12.246 ms) : 0, 12246
Telemetry [candidate] (9.829 ms) : 0, 9829
Flare Poller [baseline] (3.532 ms) : 0, 3532
Flare Poller [candidate] (3.591 ms) : 0, 3591
IAST [baseline] (25.839 ms) : 0, 25839
IAST [candidate] (25.775 ms) : 0, 25775
section profiling
ProfilingAgent [baseline] (93.437 ms) : 0, 93437
ProfilingAgent [candidate] (93.803 ms) : 0, 93803
crashtracking [baseline] (1.189 ms) : 0, 1189
crashtracking [candidate] (1.179 ms) : 0, 1179
BytebuddyAgent [baseline] (689.534 ms) : 0, 689534
BytebuddyAgent [candidate] (691.614 ms) : 0, 691614
AgentMeter [baseline] (9.095 ms) : 0, 9095
AgentMeter [candidate] (9.129 ms) : 0, 9129
GlobalTracer [baseline] (206.48 ms) : 0, 206480
GlobalTracer [candidate] (207.062 ms) : 0, 207062
AppSec [baseline] (32.34 ms) : 0, 32340
AppSec [candidate] (32.631 ms) : 0, 32631
Debugger [baseline] (65.653 ms) : 0, 65653
Debugger [candidate] (65.568 ms) : 0, 65568
Remote Config [baseline] (567.303 µs) : 0, 567
Remote Config [candidate] (566.07 µs) : 0, 566
Telemetry [baseline] (7.783 ms) : 0, 7783
Telemetry [candidate] (7.839 ms) : 0, 7839
Flare Poller [baseline] (3.565 ms) : 0, 3565
Flare Poller [candidate] (3.552 ms) : 0, 3552
Profiling [baseline] (94.003 ms) : 0, 94003
Profiling [candidate] (94.365 ms) : 0, 94365
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.61.0-SNAPSHOT~3cb87b4db3, baseline=1.61.0-SNAPSHOT~4fa94c4f4f
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.068 s) : 0, 1067881
Total [baseline] (8.896 s) : 0, 8896104
Agent [candidate] (1.062 s) : 0, 1061982
Total [candidate] (8.818 s) : 0, 8817716
section iast
Agent [baseline] (1.238 s) : 0, 1238121
Total [baseline] (9.557 s) : 0, 9556655
Agent [candidate] (1.226 s) : 0, 1225808
Total [candidate] (9.548 s) : 0, 9547949
gantt
title insecure-bank - break down per module: candidate=1.61.0-SNAPSHOT~3cb87b4db3, baseline=1.61.0-SNAPSHOT~4fa94c4f4f
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.251 ms) : 0, 1251
crashtracking [candidate] (1.226 ms) : 0, 1226
BytebuddyAgent [baseline] (641.767 ms) : 0, 641767
BytebuddyAgent [candidate] (637.313 ms) : 0, 637313
AgentMeter [baseline] (29.803 ms) : 0, 29803
AgentMeter [candidate] (29.528 ms) : 0, 29528
GlobalTracer [baseline] (251.254 ms) : 0, 251254
GlobalTracer [candidate] (251.083 ms) : 0, 251083
AppSec [baseline] (32.496 ms) : 0, 32496
AppSec [candidate] (32.448 ms) : 0, 32448
Debugger [baseline] (59.457 ms) : 0, 59457
Debugger [candidate] (59.498 ms) : 0, 59498
Remote Config [baseline] (598.04 µs) : 0, 598
Remote Config [candidate] (602.803 µs) : 0, 603
Telemetry [baseline] (8.158 ms) : 0, 8158
Telemetry [candidate] (8.213 ms) : 0, 8213
Flare Poller [baseline] (6.66 ms) : 0, 6660
Flare Poller [candidate] (5.815 ms) : 0, 5815
section iast
crashtracking [baseline] (1.252 ms) : 0, 1252
crashtracking [candidate] (1.232 ms) : 0, 1232
BytebuddyAgent [baseline] (814.008 ms) : 0, 814008
BytebuddyAgent [candidate] (803.308 ms) : 0, 803308
AgentMeter [baseline] (11.815 ms) : 0, 11815
AgentMeter [candidate] (11.381 ms) : 0, 11381
GlobalTracer [baseline] (240.337 ms) : 0, 240337
GlobalTracer [candidate] (239.644 ms) : 0, 239644
IAST [baseline] (25.911 ms) : 0, 25911
IAST [candidate] (25.81 ms) : 0, 25810
AppSec [baseline] (31.017 ms) : 0, 31017
AppSec [candidate] (30.981 ms) : 0, 30981
Debugger [baseline] (60.987 ms) : 0, 60987
Debugger [candidate] (62.045 ms) : 0, 62045
Remote Config [baseline] (531.565 µs) : 0, 532
Remote Config [candidate] (1.139 ms) : 0, 1139
Telemetry [baseline] (11.781 ms) : 0, 11781
Telemetry [candidate] (10.473 ms) : 0, 10473
Flare Poller [baseline] (3.613 ms) : 0, 3613
Flare Poller [candidate] (3.631 ms) : 0, 3631
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 0 performance regressions! Performance is the same for 16 metrics, 18 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~3cb87b4db3, baseline=1.61.0-SNAPSHOT~4fa94c4f4f
dateFormat X
axisFormat %s
section baseline
no_agent (17.996 ms) : 17812, 18180
. : milestone, 17996,
appsec (18.493 ms) : 18307, 18679
. : milestone, 18493,
code_origins (18.007 ms) : 17825, 18189
. : milestone, 18007,
iast (18.059 ms) : 17882, 18237
. : milestone, 18059,
profiling (18.663 ms) : 18483, 18843
. : milestone, 18663,
tracing (17.814 ms) : 17636, 17991
. : milestone, 17814,
section candidate
no_agent (18.215 ms) : 18028, 18403
. : milestone, 18215,
appsec (18.998 ms) : 18809, 19187
. : milestone, 18998,
code_origins (17.872 ms) : 17699, 18044
. : milestone, 17872,
iast (17.995 ms) : 17820, 18170
. : milestone, 17995,
profiling (18.653 ms) : 18468, 18839
. : milestone, 18653,
tracing (17.847 ms) : 17674, 18020
. : milestone, 17847,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.61.0-SNAPSHOT~3cb87b4db3, baseline=1.61.0-SNAPSHOT~4fa94c4f4f
dateFormat X
axisFormat %s
section baseline
no_agent (1.282 ms) : 1269, 1295
. : milestone, 1282,
iast (3.179 ms) : 3135, 3222
. : milestone, 3179,
iast_FULL (6.097 ms) : 6033, 6161
. : milestone, 6097,
iast_GLOBAL (3.708 ms) : 3647, 3768
. : milestone, 3708,
profiling (2.31 ms) : 2289, 2331
. : milestone, 2310,
tracing (1.87 ms) : 1855, 1886
. : milestone, 1870,
section candidate
no_agent (1.233 ms) : 1222, 1245
. : milestone, 1233,
iast (3.205 ms) : 3163, 3248
. : milestone, 3205,
iast_FULL (5.899 ms) : 5839, 5959
. : milestone, 5899,
iast_GLOBAL (3.489 ms) : 3439, 3540
. : milestone, 3489,
profiling (2.178 ms) : 2158, 2197
. : milestone, 2178,
tracing (1.914 ms) : 1896, 1932
. : milestone, 1914,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 1 unstable metrics. Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~3cb87b4db3, baseline=1.61.0-SNAPSHOT~4fa94c4f4f
dateFormat X
axisFormat %s
section baseline
no_agent (14.953 s) : 14953000, 14953000
. : milestone, 14953000,
appsec (14.619 s) : 14619000, 14619000
. : milestone, 14619000,
iast (18.313 s) : 18313000, 18313000
. : milestone, 18313000,
iast_GLOBAL (17.913 s) : 17913000, 17913000
. : milestone, 17913000,
profiling (15.394 s) : 15394000, 15394000
. : milestone, 15394000,
tracing (15.116 s) : 15116000, 15116000
. : milestone, 15116000,
section candidate
no_agent (14.945 s) : 14945000, 14945000
. : milestone, 14945000,
appsec (14.647 s) : 14647000, 14647000
. : milestone, 14647000,
iast (18.493 s) : 18493000, 18493000
. : milestone, 18493000,
iast_GLOBAL (17.277 s) : 17277000, 17277000
. : milestone, 17277000,
profiling (15.015 s) : 15015000, 15015000
. : milestone, 15015000,
tracing (14.884 s) : 14884000, 14884000
. : milestone, 14884000,
Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.61.0-SNAPSHOT~3cb87b4db3, baseline=1.61.0-SNAPSHOT~4fa94c4f4f
dateFormat X
axisFormat %s
section baseline
no_agent (1.488 ms) : 1476, 1500
. : milestone, 1488,
appsec (3.772 ms) : 3552, 3992
. : milestone, 3772,
iast (2.281 ms) : 2211, 2351
. : milestone, 2281,
iast_GLOBAL (2.317 ms) : 2247, 2387
. : milestone, 2317,
profiling (2.106 ms) : 2051, 2161
. : milestone, 2106,
tracing (2.082 ms) : 2028, 2136
. : milestone, 2082,
section candidate
no_agent (1.491 ms) : 1480, 1503
. : milestone, 1491,
appsec (3.831 ms) : 3609, 4052
. : milestone, 3831,
iast (2.274 ms) : 2205, 2344
. : milestone, 2274,
iast_GLOBAL (2.324 ms) : 2254, 2394
. : milestone, 2324,
profiling (2.094 ms) : 2039, 2149
. : milestone, 2094,
tracing (2.077 ms) : 2023, 2131
. : milestone, 2077,
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
This PR is rejected because it was updated |
- On Java 8, neither ddprof MEMLEAK (requires Java 11+) nor JFR OldObjectSample is available; explicitly enabling profiling.heap.enabled now logs a warning instead of silently enabling an unsupported event - ddprofLikelyActive heuristic uses isJmethodIDSafe() as the default for the liveheap flag (was hardcoded true), matching ddprof's own resolution and preventing false disablement of OldObjectSample on Java 11.0.12-11.0.22 and 17.0.3-17.0.10 - Fix testHeapProfilerIsStillOverriddenThroughConfig to expect isOldObjectSampleAvailable() instead of unconditional true Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What Does This Do
Changes
profiling.heap.enabledfrom a JFR-only flag (defaultfalse) to a unified live heap master switch that auto-detects safe systems and enables live heap profiling by default. The ddprof native library is prioritized, with JFRjdk.OldObjectSampleas an automatic fallback when ddprof is not active.Enablement Logic
flowchart TD A["profiling.heap.enabled\n(unified master switch)\ndefault: isLiveHeapProfilingSafe()"] A -->|"false"| B["ALL live heap OFF\n(ddprof + JFR)"] A -->|"unset or true"| C{Split into two paths} C --> D["ddprof path\nDatadogProfilerConfig"] C --> E["JFR path\nOpenJdkController"] D --> J11{"Java 11+?\n(JVMTI Allocation Sampler\nrequired)"} J11 -->|no| J11NO["ddprof MEMLEAK OFF\n(JFR fallback if available)"] J11 -->|yes| F["profiling.ddprof.liveheap.enabled"] F -->|"false"| G["MEMLEAK OFF"] F -->|"unset or true"\ndefault = isJmethodIDSafe| H{"JVM safe?\n11.0.23+, 17.0.11+,\n21.0.3+, 22+"} H -->|yes| I[MEMLEAK ON] H -->|no| JWARN["MEMLEAK ON\n⚠️ warn: not stable on this JVM"] G --> GCHK{"JFR OldObjectSample\navailable?\n11.0.12+, 17.0.3+, 18+"} GCHK -->|no| GWARN["⚠️ warn: live heap\nwill be inactive"] GCHK -->|yes| GOK[JFR fallback active] E --> EJCHK{"Java 11+ AND\nddprof likely active?\n(liveheap default = isJmethodIDSafe())"} EJCHK -->|yes| NOKEY_OFF["OldObjectSample OFF\n(ddprof handles live heap)"] EJCHK -->|no| NOKEY_JFP{"JFR OldObjectSample\navailable?\n11.0.12+, 17.0.3+, 18+"} NOKEY_JFP -->|yes| O["OldObjectSample ON\n(JFR fallback)"] NOKEY_JFP -->|no| P["OldObjectSample OFF\n⚠️ warn if explicitly enabled"] style B fill:#f66,color:#fff style G fill:#f66,color:#fff style J11NO fill:#f66,color:#fff style NOKEY_OFF fill:#69c,color:#fff style P fill:#f66,color:#fff style GWARN fill:#fa0,color:#fff style I fill:#6b6,color:#fff style JWARN fill:#fa0,color:#fff style O fill:#6b6,color:#fff style GOK fill:#6b6,color:#fffMotivation
Live heap profiling provides valuable memory leak detection but was previously opt-in (
profiling.ddprof.liveheap.enableddefaulted tofalse). Users had to know about and explicitly enable it.This change makes it enabled by default on safe systems, matching the pattern already used by allocation profiling. The two live heap mechanisms (ddprof native and JFR OldObjectSample) are now unified under
profiling.heap.enabledwith automatic fallback.PROF-14188
Additional Notes
profiling.heap.enabledsemantics changed: was JFR-only (defaultfalse), now unified master switch (default auto-detect viaProfilingSupport.isLiveHeapProfilingSafe())isLiveHeapProfilingSafe()=isJmethodIDSafe() || isOldObjectSampleAvailable()(moved toProfilingSupport)falseto dynamicisJmethodIDSafe()ddprofLikelyActiveheuristic inOpenJdkControllerusesisJmethodIDSafe()as the default for the liveheap flag, matching ddprof's own resolution logic — prevents silently losing live heap on versions where OldObjectSample is available but ddprof won't actually enable MEMLEAK (e.g. Java 11.0.12–11.0.22, 17.0.3–17.0.10)profiling.heap.enabled=truelogs a warning but has no effectisEventEnabledwas called withjdk.OldObjectSample#enabledwhich resulted in a double#enabledlookup, making the warning dead codeContributor 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 issueJira ticket: PROF-14188
Note: Once your PR is ready to merge, add it to the merge queue by commenting
/merge./merge -ccancels the queue request./merge -f --reason "reason"skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.