Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in Exception Replay #7885

Merged
merged 2 commits into from
Nov 5, 2024
Merged

Conversation

jpbempel
Copy link
Member

@jpbempel jpbempel commented Nov 5, 2024

What Does This Do

The weak map stateByThrowable keep the throwable as the key but this exception is also strong referenced by snapshots stored inside the ThrowableState in CapturedThrowable and in locals and extensions for @exception.
Fixing by storing weak reference inside the CapturedThrowable and clearing the other ref for @exception at commit time

Motivation

#7880

Additional Notes

Contributor Checklist

Jira ticket: DEBUG-3102

The weak map stateByThrowable keep the throwable as the key but this
exception is also strong referenced by snapshots stored inside the
ThrowableState in CapturedThrowable and in locals and extensions for
@exception.
Fixing by storing weak reference inside the CapturedThrowable and
clearing the other ref for @exception at commit time
@jpbempel jpbempel requested a review from a team as a code owner November 5, 2024 13:17
@jpbempel jpbempel requested review from cimi and removed request for a team November 5, 2024 13:17
@pr-commenter
Copy link

pr-commenter bot commented Nov 5, 2024

Debugger benchmarks

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
ci_job_date 1730813140 1730813523
end_time 2024-11-05T13:26:56 2024-11-05T13:33:19
git_branch master jpbempel/fix-mem-leak-er
git_commit_sha 281aa19 9f3819f
start_time 2024-11-05T13:25:41 2024-11-05T13:32:04
See matching parameters
Baseline Candidate
ci_job_id 695589284 695589284
ci_pipeline_id 48250691 48250691
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
git_commit_date 1730812555 1730812555

Summary

Found 0 performance improvements and 7 performance regressions! Performance is the same for 3 metrics, 5 unstable metrics.

scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:basic worse
[+34.990µs; +45.550µs] or [+12.901%; +16.795%]
worse
[+34.278µs; +48.758µs] or [+11.413%; +16.234%]
worse
[+34.376µs; +50.775µs] or [+11.135%; +16.447%]
unstable
[+7.700µs; +101.484µs] or [+1.443%; +19.021%]
worse
[-408.608op/s; -203.527op/s] or [-15.527%; -7.734%]
scenario:loop worse
[+161.813µs; +247.190µs] or [+1.533%; +2.342%]
worse
[+150.550µs; +267.205µs] or [+1.403%; +2.490%]
worse
[+148.368µs; +293.554µs] or [+1.373%; +2.716%]
same unsure
[-3.368op/s; -0.783op/s] or [-3.655%; -0.850%]
See unchanged results
scenario Δ mean agg_http_req_duration_min Δ mean agg_http_req_duration_p50 Δ mean agg_http_req_duration_p75 Δ mean agg_http_req_duration_p99 Δ mean throughput
scenario:noprobe unstable
[-19.987µs; +31.715µs] or [-7.638%; +12.121%]
unstable
[-27.005µs; +44.780µs] or [-9.025%; +14.966%]
unstable
[-29.216µs; +64.846µs] or [-9.318%; +20.681%]
unstable
[-158.508µs; +106.538µs] or [-24.308%; +16.338%]
same
Request duration reports for reports
gantt
    title reports - request duration [CI 0.99] : candidate=None, baseline=None
    dateFormat X
    axisFormat %s
section baseline
noprobe (299.209 µs) : 277, 321
.   : milestone, 299,
basic (300.335 µs) : 292, 308
.   : milestone, 300,
loop (10.733 ms) : 10664, 10803
.   : milestone, 10733,
section candidate
noprobe (308.096 µs) : 265, 351
.   : milestone, 308,
basic (341.852 µs) : 336, 348
.   : milestone, 342,
loop (10.942 ms) : 10910, 10974
.   : milestone, 10942,
Loading
  • baseline results
Scenario Request median duration [CI 0.99]
noprobe 299.209 µs [276.985 µs, 321.433 µs]
basic 300.335 µs [292.237 µs, 308.433 µs]
loop 10.733 ms [10.664 ms, 10.803 ms]
  • candidate results
Scenario Request median duration [CI 0.99]
noprobe 308.096 µs [265.1 µs, 351.092 µs]
basic 341.852 µs [335.972 µs, 347.733 µs]
loop 10.942 ms [10.91 ms, 10.974 ms]

@pr-commenter
Copy link

pr-commenter bot commented Nov 5, 2024

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master jpbempel/fix-mem-leak-er
git_commit_date 1730808942 1730812555
git_commit_sha 281aa19 9f3819f
release_version 1.43.0-SNAPSHOT~281aa195dc 1.43.0-SNAPSHOT~9f3819f735
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1730814867 1730814867
ci_job_id 695589278 695589278
ci_pipeline_id 48250691 48250691
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
module Agent Agent
parent None None
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 53 metrics, 10 unstable metrics.

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.43.0-SNAPSHOT~9f3819f735, baseline=1.43.0-SNAPSHOT~281aa195dc

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.08 s) : 0, 1080398
Total [baseline] (10.342 s) : 0, 10341756
Agent [candidate] (1.081 s) : 0, 1080703
Total [candidate] (10.397 s) : 0, 10396725
section appsec
Agent [baseline] (1.214 s) : 0, 1213746
Total [baseline] (10.646 s) : 0, 10645828
Agent [candidate] (1.215 s) : 0, 1215135
Total [candidate] (10.691 s) : 0, 10691027
section iast
Agent [baseline] (1.223 s) : 0, 1223038
Total [baseline] (10.926 s) : 0, 10925908
Agent [candidate] (1.206 s) : 0, 1205934
Total [candidate] (10.986 s) : 0, 10986330
section profiling
Agent [baseline] (1.285 s) : 0, 1285382
Total [baseline] (10.77 s) : 0, 10770479
Agent [candidate] (1.278 s) : 0, 1277782
Total [candidate] (10.689 s) : 0, 10689416
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.08 s -
Agent appsec 1.214 s 133.348 ms (12.3%)
Agent iast 1.223 s 142.639 ms (13.2%)
Agent profiling 1.285 s 204.984 ms (19.0%)
Total tracing 10.342 s -
Total appsec 10.646 s 304.072 ms (2.9%)
Total iast 10.926 s 584.152 ms (5.6%)
Total profiling 10.77 s 428.723 ms (4.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.081 s -
Agent appsec 1.215 s 134.432 ms (12.4%)
Agent iast 1.206 s 125.231 ms (11.6%)
Agent profiling 1.278 s 197.078 ms (18.2%)
Total tracing 10.397 s -
Total appsec 10.691 s 294.301 ms (2.8%)
Total iast 10.986 s 589.605 ms (5.7%)
Total profiling 10.689 s 292.691 ms (2.8%)
gantt
    title petclinic - break down per module: candidate=1.43.0-SNAPSHOT~9f3819f735, baseline=1.43.0-SNAPSHOT~281aa195dc

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (687.479 ms) : 0, 687479
BytebuddyAgent [candidate] (686.824 ms) : 0, 686824
GlobalTracer [baseline] (315.147 ms) : 0, 315147
GlobalTracer [candidate] (315.661 ms) : 0, 315661
AppSec [baseline] (54.376 ms) : 0, 54376
AppSec [candidate] (54.233 ms) : 0, 54233
Remote Config [baseline] (662.789 µs) : 0, 663
Remote Config [candidate] (661.696 µs) : 0, 662
Telemetry [baseline] (9.099 ms) : 0, 9099
Telemetry [candidate] (9.687 ms) : 0, 9687
section appsec
BytebuddyAgent [baseline] (703.736 ms) : 0, 703736
BytebuddyAgent [candidate] (704.131 ms) : 0, 704131
GlobalTracer [baseline] (312.33 ms) : 0, 312330
GlobalTracer [candidate] (312.919 ms) : 0, 312919
AppSec [baseline] (166.048 ms) : 0, 166048
AppSec [candidate] (166.35 ms) : 0, 166350
IAST [baseline] (19.399 ms) : 0, 19399
IAST [candidate] (18.757 ms) : 0, 18757
Remote Config [baseline] (634.049 µs) : 0, 634
Remote Config [candidate] (632.167 µs) : 0, 632
Telemetry [baseline] (7.711 ms) : 0, 7711
Telemetry [candidate] (8.112 ms) : 0, 8112
section iast
BytebuddyAgent [baseline] (814.161 ms) : 0, 814161
BytebuddyAgent [candidate] (801.829 ms) : 0, 801829
GlobalTracer [baseline] (307.445 ms) : 0, 307445
GlobalTracer [candidate] (304.226 ms) : 0, 304226
AppSec [baseline] (56.05 ms) : 0, 56050
AppSec [candidate] (57.526 ms) : 0, 57526
IAST [baseline] (23.374 ms) : 0, 23374
IAST [candidate] (20.615 ms) : 0, 20615
Remote Config [baseline] (648.371 µs) : 0, 648
Remote Config [candidate] (614.932 µs) : 0, 615
Telemetry [baseline] (7.567 ms) : 0, 7567
Telemetry [candidate] (7.475 ms) : 0, 7475
section profiling
BytebuddyAgent [baseline] (685.616 ms) : 0, 685616
BytebuddyAgent [candidate] (680.901 ms) : 0, 680901
GlobalTracer [baseline] (400.347 ms) : 0, 400347
GlobalTracer [candidate] (398.322 ms) : 0, 398322
AppSec [baseline] (54.761 ms) : 0, 54761
AppSec [candidate] (54.431 ms) : 0, 54431
Remote Config [baseline] (682.948 µs) : 0, 683
Remote Config [candidate] (671.179 µs) : 0, 671
Telemetry [baseline] (13.984 ms) : 0, 13984
Telemetry [candidate] (13.368 ms) : 0, 13368
ProfilingAgent [baseline] (90.785 ms) : 0, 90785
ProfilingAgent [candidate] (91.181 ms) : 0, 91181
Profiling [baseline] (90.809 ms) : 0, 90809
Profiling [candidate] (91.204 ms) : 0, 91204
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.43.0-SNAPSHOT~9f3819f735, baseline=1.43.0-SNAPSHOT~281aa195dc

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.08 s) : 0, 1080241
Total [baseline] (8.557 s) : 0, 8557390
Agent [candidate] (1.087 s) : 0, 1087386
Total [candidate] (8.567 s) : 0, 8566875
section iast
Agent [baseline] (1.203 s) : 0, 1203345
Total [baseline] (9.109 s) : 0, 9109246
Agent [candidate] (1.203 s) : 0, 1202719
Total [candidate] (9.146 s) : 0, 9146197
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.204 s) : 0, 1204019
Total [baseline] (9.115 s) : 0, 9115062
Agent [candidate] (1.206 s) : 0, 1206228
Total [candidate] (9.109 s) : 0, 9108647
section iast_TELEMETRY_OFF
Agent [baseline] (1.211 s) : 0, 1211417
Total [baseline] (9.151 s) : 0, 9151201
Agent [candidate] (1.202 s) : 0, 1201968
Total [candidate] (9.095 s) : 0, 9095088
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.08 s -
Agent iast 1.203 s 123.104 ms (11.4%)
Agent iast_HARDCODED_SECRET_DISABLED 1.204 s 123.778 ms (11.5%)
Agent iast_TELEMETRY_OFF 1.211 s 131.176 ms (12.1%)
Total tracing 8.557 s -
Total iast 9.109 s 551.856 ms (6.4%)
Total iast_HARDCODED_SECRET_DISABLED 9.115 s 557.672 ms (6.5%)
Total iast_TELEMETRY_OFF 9.151 s 593.811 ms (6.9%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.087 s -
Agent iast 1.203 s 115.332 ms (10.6%)
Agent iast_HARDCODED_SECRET_DISABLED 1.206 s 118.842 ms (10.9%)
Agent iast_TELEMETRY_OFF 1.202 s 114.581 ms (10.5%)
Total tracing 8.567 s -
Total iast 9.146 s 579.323 ms (6.8%)
Total iast_HARDCODED_SECRET_DISABLED 9.109 s 541.772 ms (6.3%)
Total iast_TELEMETRY_OFF 9.095 s 528.214 ms (6.2%)
gantt
    title insecure-bank - break down per module: candidate=1.43.0-SNAPSHOT~9f3819f735, baseline=1.43.0-SNAPSHOT~281aa195dc

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (686.849 ms) : 0, 686849
BytebuddyAgent [candidate] (691.523 ms) : 0, 691523
GlobalTracer [baseline] (314.915 ms) : 0, 314915
GlobalTracer [candidate] (316.996 ms) : 0, 316996
AppSec [baseline] (54.299 ms) : 0, 54299
AppSec [candidate] (54.033 ms) : 0, 54033
Remote Config [baseline] (661.642 µs) : 0, 662
Remote Config [candidate] (659.294 µs) : 0, 659
Telemetry [baseline] (9.905 ms) : 0, 9905
Telemetry [candidate] (10.427 ms) : 0, 10427
section iast
BytebuddyAgent [baseline] (800.285 ms) : 0, 800285
BytebuddyAgent [candidate] (800.108 ms) : 0, 800108
GlobalTracer [baseline] (303.38 ms) : 0, 303380
GlobalTracer [candidate] (302.816 ms) : 0, 302816
AppSec [baseline] (55.892 ms) : 0, 55892
AppSec [candidate] (56.147 ms) : 0, 56147
IAST [baseline] (22.15 ms) : 0, 22150
IAST [candidate] (22.015 ms) : 0, 22015
Remote Config [baseline] (607.811 µs) : 0, 608
Remote Config [candidate] (605.347 µs) : 0, 605
Telemetry [baseline] (7.422 ms) : 0, 7422
Telemetry [candidate] (7.428 ms) : 0, 7428
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (801.09 ms) : 0, 801090
BytebuddyAgent [candidate] (802.691 ms) : 0, 802691
GlobalTracer [baseline] (303.219 ms) : 0, 303219
GlobalTracer [candidate] (304.39 ms) : 0, 304390
AppSec [baseline] (56.647 ms) : 0, 56647
AppSec [candidate] (57.064 ms) : 0, 57064
IAST [baseline] (21.37 ms) : 0, 21370
IAST [candidate] (20.368 ms) : 0, 20368
Remote Config [baseline] (607.29 µs) : 0, 607
Remote Config [candidate] (604.315 µs) : 0, 604
Telemetry [baseline] (7.481 ms) : 0, 7481
Telemetry [candidate] (7.465 ms) : 0, 7465
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (805.804 ms) : 0, 805804
BytebuddyAgent [candidate] (798.593 ms) : 0, 798593
GlobalTracer [baseline] (305.892 ms) : 0, 305892
GlobalTracer [candidate] (304.331 ms) : 0, 304331
AppSec [baseline] (57.675 ms) : 0, 57675
AppSec [candidate] (56.874 ms) : 0, 56874
IAST [baseline] (20.273 ms) : 0, 20273
IAST [candidate] (20.652 ms) : 0, 20652
Remote Config [baseline] (606.405 µs) : 0, 606
Remote Config [candidate] (595.442 µs) : 0, 595
Telemetry [baseline] (7.423 ms) : 0, 7423
Telemetry [candidate] (7.297 ms) : 0, 7297
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2024-11-05T13:24:46 2024-11-05T13:31:41
git_branch master jpbempel/fix-mem-leak-er
git_commit_date 1730808942 1730812555
git_commit_sha 281aa19 9f3819f
release_version 1.43.0-SNAPSHOT~281aa195dc 1.43.0-SNAPSHOT~9f3819f735
start_time 2024-11-05T13:24:33 2024-11-05T13:31:27
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1730813849 1730813849
ci_job_id 695589279 695589279
ci_pipeline_id 48250691 48250691
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant iast iast

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 11 metrics, 17 unstable metrics.

Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.43.0-SNAPSHOT~9f3819f735, baseline=1.43.0-SNAPSHOT~281aa195dc
    dateFormat X
    axisFormat %s
section baseline
no_agent (368.917 µs) : 348, 389
.   : milestone, 369,
iast (477.717 µs) : 457, 499
.   : milestone, 478,
iast_FULL (640.791 µs) : 619, 662
.   : milestone, 641,
iast_GLOBAL (506.873 µs) : 485, 529
.   : milestone, 507,
iast_HARDCODED_SECRET_DISABLED (482.925 µs) : 462, 504
.   : milestone, 483,
iast_INACTIVE (452.961 µs) : 431, 475
.   : milestone, 453,
iast_TELEMETRY_OFF (471.093 µs) : 450, 492
.   : milestone, 471,
tracing (440.448 µs) : 420, 461
.   : milestone, 440,
section candidate
no_agent (365.963 µs) : 346, 386
.   : milestone, 366,
iast (485.576 µs) : 464, 507
.   : milestone, 486,
iast_FULL (637.828 µs) : 616, 659
.   : milestone, 638,
iast_GLOBAL (504.511 µs) : 483, 526
.   : milestone, 505,
iast_HARDCODED_SECRET_DISABLED (480.853 µs) : 459, 502
.   : milestone, 481,
iast_INACTIVE (444.503 µs) : 423, 466
.   : milestone, 445,
iast_TELEMETRY_OFF (472.054 µs) : 451, 493
.   : milestone, 472,
tracing (438.536 µs) : 418, 459
.   : milestone, 439,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 368.917 µs [348.369 µs, 389.465 µs] -
iast 477.717 µs [456.697 µs, 498.737 µs] 108.8 µs (29.5%)
iast_FULL 640.791 µs [619.306 µs, 662.277 µs] 271.874 µs (73.7%)
iast_GLOBAL 506.873 µs [485.044 µs, 528.702 µs] 137.956 µs (37.4%)
iast_HARDCODED_SECRET_DISABLED 482.925 µs [461.889 µs, 503.96 µs] 114.007 µs (30.9%)
iast_INACTIVE 452.961 µs [430.908 µs, 475.014 µs] 84.043 µs (22.8%)
iast_TELEMETRY_OFF 471.093 µs [449.753 µs, 492.433 µs] 102.176 µs (27.7%)
tracing 440.448 µs [419.852 µs, 461.044 µs] 71.531 µs (19.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 365.963 µs [345.89 µs, 386.035 µs] -
iast 485.576 µs [463.89 µs, 507.263 µs] 119.614 µs (32.7%)
iast_FULL 637.828 µs [616.322 µs, 659.334 µs] 271.865 µs (74.3%)
iast_GLOBAL 504.511 µs [483.391 µs, 525.631 µs] 138.548 µs (37.9%)
iast_HARDCODED_SECRET_DISABLED 480.853 µs [459.457 µs, 502.25 µs] 114.891 µs (31.4%)
iast_INACTIVE 444.503 µs [423.184 µs, 465.822 µs] 78.54 µs (21.5%)
iast_TELEMETRY_OFF 472.054 µs [450.666 µs, 493.441 µs] 106.091 µs (29.0%)
tracing 438.536 µs [418.13 µs, 458.941 µs] 72.573 µs (19.8%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.43.0-SNAPSHOT~9f3819f735, baseline=1.43.0-SNAPSHOT~281aa195dc
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.343 ms) : 1324, 1363
.   : milestone, 1343,
appsec (1.714 ms) : 1689, 1739
.   : milestone, 1714,
appsec_no_iast (1.707 ms) : 1682, 1731
.   : milestone, 1707,
iast (1.467 ms) : 1445, 1490
.   : milestone, 1467,
profiling (1.502 ms) : 1478, 1527
.   : milestone, 1502,
tracing (1.483 ms) : 1459, 1507
.   : milestone, 1483,
section candidate
no_agent (1.351 ms) : 1331, 1370
.   : milestone, 1351,
appsec (1.716 ms) : 1692, 1740
.   : milestone, 1716,
appsec_no_iast (1.706 ms) : 1681, 1731
.   : milestone, 1706,
iast (1.466 ms) : 1444, 1489
.   : milestone, 1466,
profiling (1.472 ms) : 1449, 1495
.   : milestone, 1472,
tracing (1.462 ms) : 1439, 1486
.   : milestone, 1462,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.343 ms [1.324 ms, 1.363 ms] -
appsec 1.714 ms [1.689 ms, 1.739 ms] 370.595 µs (27.6%)
appsec_no_iast 1.707 ms [1.682 ms, 1.731 ms] 363.268 µs (27.0%)
iast 1.467 ms [1.445 ms, 1.49 ms] 123.966 µs (9.2%)
profiling 1.502 ms [1.478 ms, 1.527 ms] 159.0 µs (11.8%)
tracing 1.483 ms [1.459 ms, 1.507 ms] 139.718 µs (10.4%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 1.351 ms [1.331 ms, 1.37 ms] -
appsec 1.716 ms [1.692 ms, 1.74 ms] 365.133 µs (27.0%)
appsec_no_iast 1.706 ms [1.681 ms, 1.731 ms] 355.284 µs (26.3%)
iast 1.466 ms [1.444 ms, 1.489 ms] 115.624 µs (8.6%)
profiling 1.472 ms [1.449 ms, 1.495 ms] 120.813 µs (8.9%)
tracing 1.462 ms [1.439 ms, 1.486 ms] 111.328 µs (8.2%)

Dacapo

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master jpbempel/fix-mem-leak-er
git_commit_date 1730808942 1730812555
git_commit_sha 281aa19 9f3819f
release_version 1.43.0-SNAPSHOT~281aa195dc 1.43.0-SNAPSHOT~9f3819f735
See matching parameters
Baseline Candidate
application biojava biojava
ci_job_date 1730814501 1730814501
ci_job_id 695589280 695589280
ci_pipeline_id 48250691 48250691
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
variant appsec appsec

Summary

Found 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics.

Execution time for biojava
gantt
    title biojava - execution time [CI 0.99] : candidate=1.43.0-SNAPSHOT~9f3819f735, baseline=1.43.0-SNAPSHOT~281aa195dc
    dateFormat X
    axisFormat %s
section baseline
no_agent (15.044 s) : 15044000, 15044000
.   : milestone, 15044000,
appsec (15.026 s) : 15026000, 15026000
.   : milestone, 15026000,
iast (18.347 s) : 18347000, 18347000
.   : milestone, 18347000,
iast_GLOBAL (17.824 s) : 17824000, 17824000
.   : milestone, 17824000,
profiling (15.273 s) : 15273000, 15273000
.   : milestone, 15273000,
tracing (14.903 s) : 14903000, 14903000
.   : milestone, 14903000,
section candidate
no_agent (14.964 s) : 14964000, 14964000
.   : milestone, 14964000,
appsec (15.121 s) : 15121000, 15121000
.   : milestone, 15121000,
iast (18.392 s) : 18392000, 18392000
.   : milestone, 18392000,
iast_GLOBAL (18.502 s) : 18502000, 18502000
.   : milestone, 18502000,
profiling (14.91 s) : 14910000, 14910000
.   : milestone, 14910000,
tracing (15.199 s) : 15199000, 15199000
.   : milestone, 15199000,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 15.044 s [15.044 s, 15.044 s] -
appsec 15.026 s [15.026 s, 15.026 s] -18.0 ms (-0.1%)
iast 18.347 s [18.347 s, 18.347 s] 3.303 s (22.0%)
iast_GLOBAL 17.824 s [17.824 s, 17.824 s] 2.78 s (18.5%)
profiling 15.273 s [15.273 s, 15.273 s] 229.0 ms (1.5%)
tracing 14.903 s [14.903 s, 14.903 s] -141.0 ms (-0.9%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 14.964 s [14.964 s, 14.964 s] -
appsec 15.121 s [15.121 s, 15.121 s] 157.0 ms (1.0%)
iast 18.392 s [18.392 s, 18.392 s] 3.428 s (22.9%)
iast_GLOBAL 18.502 s [18.502 s, 18.502 s] 3.538 s (23.6%)
profiling 14.91 s [14.91 s, 14.91 s] -54.0 ms (-0.4%)
tracing 15.199 s [15.199 s, 15.199 s] 235.0 ms (1.6%)
Execution time for tomcat
gantt
    title tomcat - execution time [CI 0.99] : candidate=1.43.0-SNAPSHOT~9f3819f735, baseline=1.43.0-SNAPSHOT~281aa195dc
    dateFormat X
    axisFormat %s
section baseline
no_agent (1.46 ms) : 1448, 1471
.   : milestone, 1460,
appsec (2.316 ms) : 2276, 2357
.   : milestone, 2316,
iast (2.058 ms) : 2007, 2109
.   : milestone, 2058,
iast_GLOBAL (2.104 ms) : 2052, 2156
.   : milestone, 2104,
profiling (1.923 ms) : 1881, 1965
.   : milestone, 1923,
tracing (1.916 ms) : 1875, 1956
.   : milestone, 1916,
section candidate
no_agent (1.462 ms) : 1450, 1473
.   : milestone, 1462,
appsec (2.332 ms) : 2291, 2374
.   : milestone, 2332,
iast (2.07 ms) : 2018, 2123
.   : milestone, 2070,
iast_GLOBAL (2.111 ms) : 2059, 2164
.   : milestone, 2111,
profiling (1.946 ms) : 1904, 1988
.   : milestone, 1946,
tracing (1.911 ms) : 1871, 1951
.   : milestone, 1911,
Loading
  • baseline results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.46 ms [1.448 ms, 1.471 ms] -
appsec 2.316 ms [2.276 ms, 2.357 ms] 856.527 µs (58.7%)
iast 2.058 ms [2.007 ms, 2.109 ms] 597.884 µs (41.0%)
iast_GLOBAL 2.104 ms [2.052 ms, 2.156 ms] 644.151 µs (44.1%)
profiling 1.923 ms [1.881 ms, 1.965 ms] 463.119 µs (31.7%)
tracing 1.916 ms [1.875 ms, 1.956 ms] 455.661 µs (31.2%)
  • candidate results
Variant Execution Time [CI 0.99] Δ no_agent
no_agent 1.462 ms [1.45 ms, 1.473 ms] -
appsec 2.332 ms [2.291 ms, 2.374 ms] 870.712 µs (59.6%)
iast 2.07 ms [2.018 ms, 2.123 ms] 608.769 µs (41.7%)
iast_GLOBAL 2.111 ms [2.059 ms, 2.164 ms] 649.68 µs (44.5%)
profiling 1.946 ms [1.904 ms, 1.988 ms] 484.292 µs (33.1%)
tracing 1.911 ms [1.871 ms, 1.951 ms] 449.709 µs (30.8%)

@@ -107,6 +112,9 @@ public void commit(
* - DebuggerContext.commit()
*/
snapshot.recordStackTrace(4);
// clear any strong ref to the exception before adding the snapshot to avoid leaking snapshots
// inside the stateByThrowable map
clearExceptionRefs(snapshot);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe done in a try/finally to make extra sure?

Copy link
Member Author

Choose a reason for hiding this comment

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

if exception happens before, snapshot won't be added to the state, so we are fine

Copy link
Contributor

@evanchooly evanchooly left a comment

Choose a reason for hiding this comment

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

looks mostly fine. WeakReferences make me nervous in general but it looks like you've covered your bases well enough.

@jpbempel jpbempel merged commit 21c0b2d into master Nov 5, 2024
81 checks passed
@jpbempel jpbempel deleted the jpbempel/fix-mem-leak-er branch November 5, 2024 17:29
@github-actions github-actions bot added this to the 1.43.0 milestone Nov 5, 2024
@jpbempel jpbempel added comp: debugger Dynamic Instrumentation type: bug labels Nov 5, 2024
jpbempel added a commit that referenced this pull request Nov 5, 2024
The weak map stateByThrowable keep the throwable as the key but this
exception is also strong referenced by snapshots stored inside the
ThrowableState in CapturedThrowable and in locals and extensions for
@exception.
Fixing by storing weak reference inside the CapturedThrowable and
clearing the other ref for @exception at commit time
jpbempel added a commit that referenced this pull request Nov 5, 2024
The weak map stateByThrowable keep the throwable as the key but this
exception is also strong referenced by snapshots stored inside the
ThrowableState in CapturedThrowable and in locals and extensions for
@exception.
Fixing by storing weak reference inside the CapturedThrowable and
clearing the other ref for @exception at commit time
jpbempel added a commit that referenced this pull request Nov 5, 2024
The weak map stateByThrowable keep the throwable as the key but this
exception is also strong referenced by snapshots stored inside the
ThrowableState in CapturedThrowable and in locals and extensions for
@exception.
Fixing by storing weak reference inside the CapturedThrowable and
clearing the other ref for @exception at commit time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: debugger Dynamic Instrumentation type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants