Do not use java.nio in crashtracking init (premain)#11080
Open
Do not use java.nio in crashtracking init (premain)#11080
Conversation
Contributor
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
jbachorik
reviewed
Apr 10, 2026
dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/ConfigManager.java
Show resolved
Hide resolved
.../agent-crashtracking/src/main/java/datadog/crashtracking/CrashUploaderScriptInitializer.java
Outdated
Show resolved
Hide resolved
dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/ConfigManager.java
Outdated
Show resolved
Hide resolved
.../agent-crashtracking/src/main/java/datadog/crashtracking/CrashUploaderScriptInitializer.java
Show resolved
Hide resolved
BenchmarksStartupParameters
See matching parameters
SummaryFound 1 performance improvements and 0 performance regressions! Performance is the same for 56 metrics, 14 unstable metrics.
Startup time reports for insecure-bankgantt
title insecure-bank - global startup overhead: candidate=1.62.0-SNAPSHOT~b0243f54d8, baseline=1.62.0-SNAPSHOT~5ab378f780
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.052 s) : 0, 1052356
Total [baseline] (8.851 s) : 0, 8851261
Agent [candidate] (1.062 s) : 0, 1061962
Total [candidate] (8.846 s) : 0, 8846023
section iast
Agent [baseline] (1.219 s) : 0, 1219471
Total [baseline] (9.551 s) : 0, 9551313
Agent [candidate] (1.221 s) : 0, 1220904
Total [candidate] (9.594 s) : 0, 9594159
gantt
title insecure-bank - break down per module: candidate=1.62.0-SNAPSHOT~b0243f54d8, baseline=1.62.0-SNAPSHOT~5ab378f780
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.227 ms) : 0, 1227
crashtracking [candidate] (1.222 ms) : 0, 1222
BytebuddyAgent [baseline] (631.971 ms) : 0, 631971
BytebuddyAgent [candidate] (636.506 ms) : 0, 636506
AgentMeter [baseline] (29.355 ms) : 0, 29355
AgentMeter [candidate] (29.676 ms) : 0, 29676
GlobalTracer [baseline] (248.107 ms) : 0, 248107
GlobalTracer [candidate] (249.691 ms) : 0, 249691
AppSec [baseline] (31.912 ms) : 0, 31912
AppSec [candidate] (32.305 ms) : 0, 32305
Debugger [baseline] (59.195 ms) : 0, 59195
Debugger [candidate] (59.596 ms) : 0, 59596
Remote Config [baseline] (610.701 µs) : 0, 611
Remote Config [candidate] (600.814 µs) : 0, 601
Telemetry [baseline] (7.996 ms) : 0, 7996
Telemetry [candidate] (8.146 ms) : 0, 8146
Flare Poller [baseline] (5.887 ms) : 0, 5887
Flare Poller [candidate] (8.089 ms) : 0, 8089
section iast
crashtracking [baseline] (1.22 ms) : 0, 1220
crashtracking [candidate] (1.225 ms) : 0, 1225
BytebuddyAgent [baseline] (798.984 ms) : 0, 798984
BytebuddyAgent [candidate] (798.766 ms) : 0, 798766
AgentMeter [baseline] (11.331 ms) : 0, 11331
AgentMeter [candidate] (11.382 ms) : 0, 11382
GlobalTracer [baseline] (238.304 ms) : 0, 238304
GlobalTracer [candidate] (239.142 ms) : 0, 239142
AppSec [baseline] (28.53 ms) : 0, 28530
AppSec [candidate] (33.381 ms) : 0, 33381
Debugger [baseline] (61.047 ms) : 0, 61047
Debugger [candidate] (56.37 ms) : 0, 56370
Remote Config [baseline] (1.122 ms) : 0, 1122
Remote Config [candidate] (522.592 µs) : 0, 523
Telemetry [baseline] (12.43 ms) : 0, 12430
Telemetry [candidate] (14.259 ms) : 0, 14259
Flare Poller [baseline] (3.742 ms) : 0, 3742
Flare Poller [candidate] (3.871 ms) : 0, 3871
IAST [baseline] (26.537 ms) : 0, 26537
IAST [candidate] (25.798 ms) : 0, 25798
Startup time reports for petclinicgantt
title petclinic - global startup overhead: candidate=1.62.0-SNAPSHOT~b0243f54d8, baseline=1.62.0-SNAPSHOT~5ab378f780
dateFormat X
axisFormat %s
section tracing
Agent [baseline] (1.064 s) : 0, 1063996
Total [baseline] (11.116 s) : 0, 11115663
Agent [candidate] (1.059 s) : 0, 1058665
Total [candidate] (11.032 s) : 0, 11031904
section appsec
Agent [baseline] (1.252 s) : 0, 1252297
Total [baseline] (11.144 s) : 0, 11144100
Agent [candidate] (1.246 s) : 0, 1245752
Total [candidate] (11.209 s) : 0, 11208873
section iast
Agent [baseline] (1.231 s) : 0, 1231457
Total [baseline] (11.311 s) : 0, 11311165
Agent [candidate] (1.223 s) : 0, 1222806
Total [candidate] (11.294 s) : 0, 11294204
section profiling
Agent [baseline] (1.184 s) : 0, 1183564
Total [baseline] (11.145 s) : 0, 11144810
Agent [candidate] (1.183 s) : 0, 1182726
Total [candidate] (11.056 s) : 0, 11056097
gantt
title petclinic - break down per module: candidate=1.62.0-SNAPSHOT~b0243f54d8, baseline=1.62.0-SNAPSHOT~5ab378f780
dateFormat X
axisFormat %s
section tracing
crashtracking [baseline] (1.243 ms) : 0, 1243
crashtracking [candidate] (1.221 ms) : 0, 1221
BytebuddyAgent [baseline] (636.261 ms) : 0, 636261
BytebuddyAgent [candidate] (634.25 ms) : 0, 634250
AgentMeter [baseline] (29.612 ms) : 0, 29612
AgentMeter [candidate] (29.327 ms) : 0, 29327
GlobalTracer [baseline] (251.085 ms) : 0, 251085
GlobalTracer [candidate] (248.212 ms) : 0, 248212
AppSec [baseline] (32.463 ms) : 0, 32463
AppSec [candidate] (31.919 ms) : 0, 31919
Debugger [baseline] (60.722 ms) : 0, 60722
Debugger [candidate] (59.656 ms) : 0, 59656
Remote Config [baseline] (601.968 µs) : 0, 602
Remote Config [candidate] (588.293 µs) : 0, 588
Telemetry [baseline] (8.2 ms) : 0, 8200
Telemetry [candidate] (8.068 ms) : 0, 8068
Flare Poller [baseline] (7.597 ms) : 0, 7597
Flare Poller [candidate] (9.248 ms) : 0, 9248
section appsec
crashtracking [baseline] (1.21 ms) : 0, 1210
crashtracking [candidate] (1.211 ms) : 0, 1211
BytebuddyAgent [baseline] (663.511 ms) : 0, 663511
BytebuddyAgent [candidate] (660.568 ms) : 0, 660568
AgentMeter [baseline] (12.082 ms) : 0, 12082
AgentMeter [candidate] (12.074 ms) : 0, 12074
GlobalTracer [baseline] (250.076 ms) : 0, 250076
GlobalTracer [candidate] (248.787 ms) : 0, 248787
AppSec [baseline] (185.251 ms) : 0, 185251
AppSec [candidate] (184.102 ms) : 0, 184102
Debugger [baseline] (66.182 ms) : 0, 66182
Debugger [candidate] (65.543 ms) : 0, 65543
Remote Config [baseline] (621.717 µs) : 0, 622
Remote Config [candidate] (606.559 µs) : 0, 607
Telemetry [baseline] (8.567 ms) : 0, 8567
Telemetry [candidate] (8.402 ms) : 0, 8402
Flare Poller [baseline] (3.574 ms) : 0, 3574
Flare Poller [candidate] (3.521 ms) : 0, 3521
IAST [baseline] (24.859 ms) : 0, 24859
IAST [candidate] (24.575 ms) : 0, 24575
section iast
crashtracking [baseline] (1.219 ms) : 0, 1219
crashtracking [candidate] (1.215 ms) : 0, 1215
BytebuddyAgent [baseline] (805.456 ms) : 0, 805456
BytebuddyAgent [candidate] (799.861 ms) : 0, 799861
AgentMeter [baseline] (11.628 ms) : 0, 11628
AgentMeter [candidate] (11.36 ms) : 0, 11360
GlobalTracer [baseline] (240.354 ms) : 0, 240354
GlobalTracer [candidate] (238.898 ms) : 0, 238898
AppSec [baseline] (30.412 ms) : 0, 30412
AppSec [candidate] (29.313 ms) : 0, 29313
Debugger [baseline] (63.092 ms) : 0, 63092
Debugger [candidate] (62.624 ms) : 0, 62624
Remote Config [baseline] (1.134 ms) : 0, 1134
Remote Config [candidate] (520.56 µs) : 0, 521
Telemetry [baseline] (12.015 ms) : 0, 12015
Telemetry [candidate] (13.385 ms) : 0, 13385
Flare Poller [baseline] (3.637 ms) : 0, 3637
Flare Poller [candidate] (3.83 ms) : 0, 3830
IAST [baseline] (25.977 ms) : 0, 25977
IAST [candidate] (25.707 ms) : 0, 25707
section profiling
crashtracking [baseline] (1.181 ms) : 0, 1181
crashtracking [candidate] (1.194 ms) : 0, 1194
BytebuddyAgent [baseline] (690.482 ms) : 0, 690482
BytebuddyAgent [candidate] (690.256 ms) : 0, 690256
AgentMeter [baseline] (9.137 ms) : 0, 9137
AgentMeter [candidate] (8.822 ms) : 0, 8822
GlobalTracer [baseline] (207.608 ms) : 0, 207608
GlobalTracer [candidate] (207.828 ms) : 0, 207828
AppSec [baseline] (32.553 ms) : 0, 32553
AppSec [candidate] (32.254 ms) : 0, 32254
Debugger [baseline] (65.539 ms) : 0, 65539
Debugger [candidate] (65.666 ms) : 0, 65666
Remote Config [baseline] (560.405 µs) : 0, 560
Remote Config [candidate] (570.703 µs) : 0, 571
Telemetry [baseline] (7.856 ms) : 0, 7856
Telemetry [candidate] (7.871 ms) : 0, 7871
Flare Poller [baseline] (3.556 ms) : 0, 3556
Flare Poller [candidate] (3.54 ms) : 0, 3540
ProfilingAgent [baseline] (93.822 ms) : 0, 93822
ProfilingAgent [candidate] (93.371 ms) : 0, 93371
Profiling [baseline] (94.388 ms) : 0, 94388
Profiling [candidate] (93.934 ms) : 0, 93934
LoadParameters
See matching parameters
SummaryFound 2 performance improvements and 1 performance regressions! Performance is the same for 18 metrics, 15 unstable metrics.
Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~b0243f54d8, baseline=1.62.0-SNAPSHOT~5ab378f780
dateFormat X
axisFormat %s
section baseline
no_agent (19.036 ms) : 18847, 19225
. : milestone, 19036,
appsec (18.768 ms) : 18579, 18957
. : milestone, 18768,
code_origins (18.97 ms) : 18780, 19159
. : milestone, 18970,
iast (18.226 ms) : 18045, 18406
. : milestone, 18226,
profiling (18.487 ms) : 18302, 18672
. : milestone, 18487,
tracing (17.894 ms) : 17719, 18070
. : milestone, 17894,
section candidate
no_agent (18.084 ms) : 17906, 18262
. : milestone, 18084,
appsec (18.846 ms) : 18658, 19035
. : milestone, 18846,
code_origins (18.95 ms) : 18757, 19142
. : milestone, 18950,
iast (18.713 ms) : 18524, 18903
. : milestone, 18713,
profiling (18.634 ms) : 18446, 18821
. : milestone, 18634,
tracing (18.977 ms) : 18787, 19167
. : milestone, 18977,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.62.0-SNAPSHOT~b0243f54d8, baseline=1.62.0-SNAPSHOT~5ab378f780
dateFormat X
axisFormat %s
section baseline
no_agent (1.254 ms) : 1241, 1266
. : milestone, 1254,
iast (3.65 ms) : 3600, 3700
. : milestone, 3650,
iast_FULL (6.3 ms) : 6234, 6367
. : milestone, 6300,
iast_GLOBAL (3.67 ms) : 3610, 3730
. : milestone, 3670,
profiling (2.148 ms) : 2125, 2171
. : milestone, 2148,
tracing (1.921 ms) : 1904, 1937
. : milestone, 1921,
section candidate
no_agent (1.236 ms) : 1224, 1247
. : milestone, 1236,
iast (3.366 ms) : 3316, 3415
. : milestone, 3366,
iast_FULL (6.196 ms) : 6132, 6260
. : milestone, 6196,
iast_GLOBAL (3.722 ms) : 3653, 3791
. : milestone, 3722,
profiling (2.148 ms) : 2130, 2167
. : milestone, 2148,
tracing (1.877 ms) : 1861, 1893
. : milestone, 1877,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 10 metrics, 2 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~b0243f54d8, baseline=1.62.0-SNAPSHOT~5ab378f780
dateFormat X
axisFormat %s
section baseline
no_agent (1.493 ms) : 1482, 1505
. : milestone, 1493,
appsec (3.86 ms) : 3637, 4084
. : milestone, 3860,
iast (2.29 ms) : 2221, 2360
. : milestone, 2290,
iast_GLOBAL (2.334 ms) : 2264, 2404
. : milestone, 2334,
profiling (2.553 ms) : 2387, 2718
. : milestone, 2553,
tracing (2.101 ms) : 2047, 2155
. : milestone, 2101,
section candidate
no_agent (1.492 ms) : 1480, 1504
. : milestone, 1492,
appsec (3.842 ms) : 3618, 4067
. : milestone, 3842,
iast (2.295 ms) : 2225, 2365
. : milestone, 2295,
iast_GLOBAL (2.334 ms) : 2264, 2405
. : milestone, 2334,
profiling (2.114 ms) : 2058, 2169
. : milestone, 2114,
tracing (2.111 ms) : 2056, 2165
. : milestone, 2111,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.62.0-SNAPSHOT~b0243f54d8, baseline=1.62.0-SNAPSHOT~5ab378f780
dateFormat X
axisFormat %s
section baseline
no_agent (15.082 s) : 15082000, 15082000
. : milestone, 15082000,
appsec (14.884 s) : 14884000, 14884000
. : milestone, 14884000,
iast (18.377 s) : 18377000, 18377000
. : milestone, 18377000,
iast_GLOBAL (18.087 s) : 18087000, 18087000
. : milestone, 18087000,
profiling (15.045 s) : 15045000, 15045000
. : milestone, 15045000,
tracing (15.263 s) : 15263000, 15263000
. : milestone, 15263000,
section candidate
no_agent (15.524 s) : 15524000, 15524000
. : milestone, 15524000,
appsec (14.942 s) : 14942000, 14942000
. : milestone, 14942000,
iast (18.831 s) : 18831000, 18831000
. : milestone, 18831000,
iast_GLOBAL (18.08 s) : 18080000, 18080000
. : milestone, 18080000,
profiling (15.014 s) : 15014000, 15014000
. : milestone, 15014000,
tracing (14.832 s) : 14832000, 14832000
. : milestone, 14832000,
|
aba8a0e to
a539994
Compare
…racking/CrashUploaderScriptInitializer.java Co-authored-by: Jaroslav Bachorik <jaroslav.bachorik@datadoghq.com>
…racking/ConfigManager.java Co-authored-by: Jaroslav Bachorik <jaroslav.bachorik@datadoghq.com>
jbachorik
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Avoid using
java.nioin the initialisation part of the crashtracking agent. This because, at this point, initializing java.nio can lead to side effects (deadlocks, premature initialisations, etc..)Also, the same operations can be done using a regular java.io
Motivation
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 issueJira ticket: [PROJ-IDENT]
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.