Skip to content

Always call System.gc() and System.runFinalization() at least once in awaitGC#8974

Merged
mcculls merged 1 commit intomasterfrom
mcculls/always-call-system-gc-in-awaitgc
Jun 12, 2025
Merged

Always call System.gc() and System.runFinalization() at least once in awaitGC#8974
mcculls merged 1 commit intomasterfrom
mcculls/always-call-system-gc-in-awaitgc

Conversation

@mcculls
Copy link
Contributor

@mcculls mcculls commented Jun 12, 2025

Motivation

Just in case the reference passed in has already been cleared via a partial GC, this way we at least try to force a full GC at least once.

There are other improvements we could make, but I don't think we need to invest too much into this test method as it's only used in a very few places.

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@mcculls mcculls requested a review from a team as a code owner June 12, 2025 13:33
@mcculls mcculls added the type: enhancement Enhancements and improvements label Jun 12, 2025
@mcculls mcculls requested a review from ygree June 12, 2025 13:33
@mcculls mcculls added the comp: tooling Build & Tooling label Jun 12, 2025
@mcculls mcculls requested a review from amarziali June 12, 2025 13:33
@mcculls mcculls force-pushed the mcculls/always-call-system-gc-in-awaitgc branch 2 times, most recently from e0c9e63 to 812bd01 Compare June 12, 2025 13:37
@mcculls mcculls force-pushed the mcculls/always-call-system-gc-in-awaitgc branch from 812bd01 to dd336bb Compare June 12, 2025 13:47
@pr-commenter
Copy link

pr-commenter bot commented Jun 12, 2025

Benchmarks

Startup

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
git_branch master mcculls/always-call-system-gc-in-awaitgc
git_commit_date 1749730552 1749735049
git_commit_sha 05d97db 812bd01a13
release_version 1.50.0-SNAPSHOT~05d97db941 1.50.0-SNAPSHOT~812bd01a13
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1749737961 1749737961
ci_job_id 978686728 978686728
ci_pipeline_id 67534058 67534058
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-2ousnmcz-project-304-concurrent-0-wzbqukfh 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-2ousnmcz-project-304-concurrent-0-wzbqukfh 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
module Agent Agent
parent None None
variant iast iast

Summary

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

Startup time reports for petclinic
gantt
    title petclinic - global startup overhead: candidate=1.50.0-SNAPSHOT~812bd01a13, baseline=1.50.0-SNAPSHOT~05d97db941

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.036 s) : 0, 1035782
Total [baseline] (10.523 s) : 0, 10522828
Agent [candidate] (1.023 s) : 0, 1022715
Total [candidate] (10.471 s) : 0, 10470992
section appsec
Agent [baseline] (1.183 s) : 0, 1182928
Total [baseline] (10.703 s) : 0, 10702601
Agent [candidate] (1.183 s) : 0, 1183052
Total [candidate] (10.752 s) : 0, 10752118
section iast
Agent [baseline] (1.159 s) : 0, 1159248
Total [baseline] (10.933 s) : 0, 10933443
Agent [candidate] (1.155 s) : 0, 1154935
Total [candidate] (10.782 s) : 0, 10781990
section profiling
Agent [baseline] (1.278 s) : 0, 1277974
Total [baseline] (10.956 s) : 0, 10956084
Agent [candidate] (1.275 s) : 0, 1274757
Total [candidate] (10.837 s) : 0, 10836533
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.036 s -
Agent appsec 1.183 s 147.146 ms (14.2%)
Agent iast 1.159 s 123.466 ms (11.9%)
Agent profiling 1.278 s 242.192 ms (23.4%)
Total tracing 10.523 s -
Total appsec 10.703 s 179.773 ms (1.7%)
Total iast 10.933 s 410.615 ms (3.9%)
Total profiling 10.956 s 433.256 ms (4.1%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.023 s -
Agent appsec 1.183 s 160.338 ms (15.7%)
Agent iast 1.155 s 132.221 ms (12.9%)
Agent profiling 1.275 s 252.042 ms (24.6%)
Total tracing 10.471 s -
Total appsec 10.752 s 281.127 ms (2.7%)
Total iast 10.782 s 310.998 ms (3.0%)
Total profiling 10.837 s 365.542 ms (3.5%)
gantt
    title petclinic - break down per module: candidate=1.50.0-SNAPSHOT~812bd01a13, baseline=1.50.0-SNAPSHOT~05d97db941

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (692.02 ms) : 0, 692020
BytebuddyAgent [candidate] (683.473 ms) : 0, 683473
GlobalTracer [baseline] (243.356 ms) : 0, 243356
GlobalTracer [candidate] (240.84 ms) : 0, 240840
AppSec [baseline] (56.325 ms) : 0, 56325
AppSec [candidate] (55.827 ms) : 0, 55827
Debugger [baseline] (6.323 ms) : 0, 6323
Debugger [candidate] (6.172 ms) : 0, 6172
Remote Config [baseline] (763.42 µs) : 0, 763
Remote Config [candidate] (741.088 µs) : 0, 741
Telemetry [baseline] (13.102 ms) : 0, 13102
Telemetry [candidate] (12.091 ms) : 0, 12091
section appsec
BytebuddyAgent [baseline] (711.401 ms) : 0, 711401
BytebuddyAgent [candidate] (709.871 ms) : 0, 709871
GlobalTracer [baseline] (236.059 ms) : 0, 236059
GlobalTracer [candidate] (236.617 ms) : 0, 236617
AppSec [baseline] (175.807 ms) : 0, 175807
AppSec [candidate] (176.884 ms) : 0, 176884
Debugger [baseline] (5.946 ms) : 0, 5946
Debugger [candidate] (5.965 ms) : 0, 5965
Remote Config [baseline] (634.049 µs) : 0, 634
Remote Config [candidate] (629.787 µs) : 0, 630
Telemetry [baseline] (7.314 ms) : 0, 7314
Telemetry [candidate] (7.427 ms) : 0, 7427
IAST [baseline] (22.088 ms) : 0, 22088
IAST [candidate] (21.986 ms) : 0, 21986
section iast
BytebuddyAgent [baseline] (808.842 ms) : 0, 808842
BytebuddyAgent [candidate] (804.507 ms) : 0, 804507
GlobalTracer [baseline] (232.198 ms) : 0, 232198
GlobalTracer [candidate] (231.793 ms) : 0, 231793
AppSec [baseline] (51.184 ms) : 0, 51184
AppSec [candidate] (52.439 ms) : 0, 52439
Debugger [baseline] (6.035 ms) : 0, 6035
Debugger [candidate] (6.054 ms) : 0, 6054
Remote Config [baseline] (616.48 µs) : 0, 616
Remote Config [candidate] (610.609 µs) : 0, 611
Telemetry [baseline] (8.045 ms) : 0, 8045
Telemetry [candidate] (8.006 ms) : 0, 8006
IAST [baseline] (28.61 ms) : 0, 28610
IAST [candidate] (27.851 ms) : 0, 27851
section profiling
BytebuddyAgent [baseline] (682.057 ms) : 0, 682057
BytebuddyAgent [candidate] (681.892 ms) : 0, 681892
GlobalTracer [baseline] (363.42 ms) : 0, 363420
GlobalTracer [candidate] (362.697 ms) : 0, 362697
AppSec [baseline] (62.057 ms) : 0, 62057
AppSec [candidate] (61.56 ms) : 0, 61560
Debugger [baseline] (6.163 ms) : 0, 6163
Debugger [candidate] (6.034 ms) : 0, 6034
Remote Config [baseline] (678.836 µs) : 0, 679
Remote Config [candidate] (658.623 µs) : 0, 659
Telemetry [baseline] (8.266 ms) : 0, 8266
Telemetry [candidate] (8.067 ms) : 0, 8067
ProfilingAgent [baseline] (104.071 ms) : 0, 104071
ProfilingAgent [candidate] (102.607 ms) : 0, 102607
Profiling [baseline] (104.095 ms) : 0, 104095
Profiling [candidate] (102.631 ms) : 0, 102631
Loading
Startup time reports for insecure-bank
gantt
    title insecure-bank - global startup overhead: candidate=1.50.0-SNAPSHOT~812bd01a13, baseline=1.50.0-SNAPSHOT~05d97db941

    dateFormat X
    axisFormat %s
section tracing
Agent [baseline] (1.03 s) : 0, 1030380
Total [baseline] (8.568 s) : 0, 8568154
Agent [candidate] (1.023 s) : 0, 1023383
Total [candidate] (8.556 s) : 0, 8556168
section iast
Agent [baseline] (1.151 s) : 0, 1151442
Total [baseline] (9.205 s) : 0, 9204956
Agent [candidate] (1.152 s) : 0, 1151875
Total [candidate] (9.198 s) : 0, 9197508
section iast_HARDCODED_SECRET_DISABLED
Agent [baseline] (1.152 s) : 0, 1152246
Total [baseline] (9.197 s) : 0, 9197208
Agent [candidate] (1.152 s) : 0, 1151649
Total [candidate] (9.165 s) : 0, 9164858
section iast_TELEMETRY_OFF
Agent [baseline] (1.149 s) : 0, 1149197
Total [baseline] (9.302 s) : 0, 9302002
Agent [candidate] (1.147 s) : 0, 1147237
Total [candidate] (9.253 s) : 0, 9253252
Loading
  • baseline results
Module Variant Duration Δ tracing
Agent tracing 1.03 s -
Agent iast 1.151 s 121.061 ms (11.7%)
Agent iast_HARDCODED_SECRET_DISABLED 1.152 s 121.866 ms (11.8%)
Agent iast_TELEMETRY_OFF 1.149 s 118.816 ms (11.5%)
Total tracing 8.568 s -
Total iast 9.205 s 636.801 ms (7.4%)
Total iast_HARDCODED_SECRET_DISABLED 9.197 s 629.054 ms (7.3%)
Total iast_TELEMETRY_OFF 9.302 s 733.848 ms (8.6%)
  • candidate results
Module Variant Duration Δ tracing
Agent tracing 1.023 s -
Agent iast 1.152 s 128.492 ms (12.6%)
Agent iast_HARDCODED_SECRET_DISABLED 1.152 s 128.266 ms (12.5%)
Agent iast_TELEMETRY_OFF 1.147 s 123.854 ms (12.1%)
Total tracing 8.556 s -
Total iast 9.198 s 641.339 ms (7.5%)
Total iast_HARDCODED_SECRET_DISABLED 9.165 s 608.689 ms (7.1%)
Total iast_TELEMETRY_OFF 9.253 s 697.083 ms (8.1%)
gantt
    title insecure-bank - break down per module: candidate=1.50.0-SNAPSHOT~812bd01a13, baseline=1.50.0-SNAPSHOT~05d97db941

    dateFormat X
    axisFormat %s
section tracing
BytebuddyAgent [baseline] (689.457 ms) : 0, 689457
BytebuddyAgent [candidate] (683.434 ms) : 0, 683434
GlobalTracer [baseline] (241.601 ms) : 0, 241601
GlobalTracer [candidate] (240.523 ms) : 0, 240523
AppSec [baseline] (57.303 ms) : 0, 57303
AppSec [candidate] (55.399 ms) : 0, 55399
Debugger [baseline] (6.164 ms) : 0, 6164
Debugger [candidate] (6.179 ms) : 0, 6179
Remote Config [baseline] (728.425 µs) : 0, 728
Remote Config [candidate] (735.107 µs) : 0, 735
Telemetry [baseline] (11.32 ms) : 0, 11320
Telemetry [candidate] (13.511 ms) : 0, 13511
section iast
BytebuddyAgent [baseline] (803.56 ms) : 0, 803560
BytebuddyAgent [candidate] (803.043 ms) : 0, 803043
GlobalTracer [baseline] (230.803 ms) : 0, 230803
GlobalTracer [candidate] (231.388 ms) : 0, 231388
IAST [baseline] (25.991 ms) : 0, 25991
IAST [candidate] (25.509 ms) : 0, 25509
AppSec [baseline] (53.139 ms) : 0, 53139
AppSec [candidate] (53.907 ms) : 0, 53907
Debugger [baseline] (5.996 ms) : 0, 5996
Debugger [candidate] (5.98 ms) : 0, 5980
Remote Config [baseline] (597.146 µs) : 0, 597
Remote Config [candidate] (606.163 µs) : 0, 606
Telemetry [baseline] (7.855 ms) : 0, 7855
Telemetry [candidate] (7.898 ms) : 0, 7898
section iast_HARDCODED_SECRET_DISABLED
BytebuddyAgent [baseline] (803.633 ms) : 0, 803633
BytebuddyAgent [candidate] (802.401 ms) : 0, 802401
GlobalTracer [baseline] (230.518 ms) : 0, 230518
GlobalTracer [candidate] (230.698 ms) : 0, 230698
IAST [baseline] (24.751 ms) : 0, 24751
IAST [candidate] (29.09 ms) : 0, 29090
AppSec [baseline] (54.587 ms) : 0, 54587
AppSec [candidate] (51.352 ms) : 0, 51352
Debugger [baseline] (5.978 ms) : 0, 5978
Debugger [candidate] (5.961 ms) : 0, 5961
Remote Config [baseline] (606.385 µs) : 0, 606
Remote Config [candidate] (597.625 µs) : 0, 598
Telemetry [baseline] (7.881 ms) : 0, 7881
Telemetry [candidate] (7.997 ms) : 0, 7997
section iast_TELEMETRY_OFF
BytebuddyAgent [baseline] (799.717 ms) : 0, 799717
BytebuddyAgent [candidate] (798.89 ms) : 0, 798890
GlobalTracer [baseline] (231.467 ms) : 0, 231467
GlobalTracer [candidate] (231.253 ms) : 0, 231253
IAST [baseline] (28.351 ms) : 0, 28351
IAST [candidate] (28.664 ms) : 0, 28664
AppSec [baseline] (51.444 ms) : 0, 51444
AppSec [candidate] (50.305 ms) : 0, 50305
Debugger [baseline] (6.051 ms) : 0, 6051
Debugger [candidate] (6.042 ms) : 0, 6042
Remote Config [baseline] (621.682 µs) : 0, 622
Remote Config [candidate] (628.609 µs) : 0, 629
Telemetry [baseline] (7.952 ms) : 0, 7952
Telemetry [candidate] (7.938 ms) : 0, 7938
Loading

Load

Parameters

Baseline Candidate
baseline_or_candidate baseline candidate
end_time 2025-06-12T13:52:06 2025-06-12T14:00:42
git_branch master mcculls/always-call-system-gc-in-awaitgc
git_commit_date 1749730552 1749735049
git_commit_sha 05d97db 812bd01a13
release_version 1.50.0-SNAPSHOT~05d97db941 1.50.0-SNAPSHOT~812bd01a13
start_time 2025-06-12T13:51:51 2025-06-12T14:00:27
See matching parameters
Baseline Candidate
application insecure-bank insecure-bank
ci_job_date 1749737176 1749737176
ci_job_id 978686734 978686734
ci_pipeline_id 67534058 67534058
cpu_model Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz
kernel_version Linux runner-66eemyw1-project-304-concurrent-0-vlxq465s 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux Linux runner-66eemyw1-project-304-concurrent-0-vlxq465s 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
thresholds_or_results results results
variant iast iast

Summary

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

scenario Δ mean http_req_duration Δ mean throughput candidate mean http_req_duration candidate mean throughput baseline mean http_req_duration baseline mean throughput
scenario:load:petclinic:no_agent worse
[+5.308ms; +5.483ms] or [+74.656%; +77.108%]
worse
[-327.394op/s; -269.088op/s] or [-47.063%; -38.681%]
12.506ms 397.411op/s 7.111ms 695.652op/s
Request duration reports for insecure-bank
gantt
    title insecure-bank - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~812bd01a13, baseline=1.50.0-SNAPSHOT~05d97db941
    dateFormat X
    axisFormat %s
section baseline
no_agent (382.976 µs) : 363, 403
.   : milestone, 383,
iast (524.259 µs) : 502, 546
.   : milestone, 524,
iast_FULL (737.743 µs) : 714, 761
.   : milestone, 738,
iast_GLOBAL (580.65 µs) : 557, 604
.   : milestone, 581,
iast_HARDCODED_SECRET_DISABLED (535.546 µs) : 514, 557
.   : milestone, 536,
iast_INACTIVE (472.203 µs) : 449, 495
.   : milestone, 472,
iast_TELEMETRY_OFF (519.526 µs) : 496, 543
.   : milestone, 520,
tracing (465.15 µs) : 443, 488
.   : milestone, 465,
section candidate
no_agent (383.822 µs) : 363, 404
.   : milestone, 384,
iast (532.589 µs) : 511, 554
.   : milestone, 533,
iast_FULL (744.954 µs) : 721, 768
.   : milestone, 745,
iast_GLOBAL (584.699 µs) : 561, 608
.   : milestone, 585,
iast_HARDCODED_SECRET_DISABLED (520.676 µs) : 498, 543
.   : milestone, 521,
iast_INACTIVE (472.758 µs) : 450, 495
.   : milestone, 473,
iast_TELEMETRY_OFF (516.845 µs) : 493, 541
.   : milestone, 517,
tracing (461.888 µs) : 440, 484
.   : milestone, 462,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 382.976 µs [363.0 µs, 402.952 µs] -
iast 524.259 µs [502.26 µs, 546.258 µs] 141.283 µs (36.9%)
iast_FULL 737.743 µs [714.104 µs, 761.383 µs] 354.767 µs (92.6%)
iast_GLOBAL 580.65 µs [557.382 µs, 603.917 µs] 197.673 µs (51.6%)
iast_HARDCODED_SECRET_DISABLED 535.546 µs [514.0 µs, 557.092 µs] 152.57 µs (39.8%)
iast_INACTIVE 472.203 µs [449.204 µs, 495.203 µs] 89.227 µs (23.3%)
iast_TELEMETRY_OFF 519.526 µs [496.495 µs, 542.556 µs] 136.549 µs (35.7%)
tracing 465.15 µs [442.641 µs, 487.658 µs] 82.173 µs (21.5%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 383.822 µs [363.385 µs, 404.259 µs] -
iast 532.589 µs [510.827 µs, 554.352 µs] 148.768 µs (38.8%)
iast_FULL 744.954 µs [721.426 µs, 768.482 µs] 361.132 µs (94.1%)
iast_GLOBAL 584.699 µs [560.992 µs, 608.406 µs] 200.877 µs (52.3%)
iast_HARDCODED_SECRET_DISABLED 520.676 µs [498.435 µs, 542.917 µs] 136.854 µs (35.7%)
iast_INACTIVE 472.758 µs [450.279 µs, 495.237 µs] 88.936 µs (23.2%)
iast_TELEMETRY_OFF 516.845 µs [492.573 µs, 541.117 µs] 133.023 µs (34.7%)
tracing 461.888 µs [439.644 µs, 484.131 µs] 78.066 µs (20.3%)
Request duration reports for petclinic
gantt
    title petclinic - request duration [CI 0.99] : candidate=1.50.0-SNAPSHOT~812bd01a13, baseline=1.50.0-SNAPSHOT~05d97db941
    dateFormat X
    axisFormat %s
section baseline
no_agent (7.111 ms) : 7088, 7133
.   : milestone, 7111,
appsec (1.794 ms) : 1704, 1885
.   : milestone, 1794,
code_origins (473.739 µs) : 421, 527
.   : milestone, 474,
iast (1.137 ms) : 1060, 1213
.   : milestone, 1137,
profiling (2.466 ms) : 2368, 2564
.   : milestone, 2466,
tracing (11.099 ms) : 11015, 11183
.   : milestone, 11099,
section candidate
no_agent (12.506 ms) : 12394, 12618
.   : milestone, 12506,
appsec (71.713 ms) : 70774, 72652
.   : milestone, 71713,
code_origins (87.42 ms) : 85992, 88847
.   : milestone, 87420,
iast (80.062 ms) : 78962, 81163
.   : milestone, 80062,
profiling (62.461 ms) : 61618, 63303
.   : milestone, 62461,
tracing (52.409 ms) : 51627, 53191
.   : milestone, 52409,
Loading
  • baseline results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 7.111 ms [7.088 ms, 7.133 ms] -
appsec 1.794 ms [1.704 ms, 1.885 ms] -5.316 ms (-74.8%)
code_origins 473.739 µs [420.704 µs, 526.773 µs] -6.637 ms (-93.3%)
iast 1.137 ms [1.06 ms, 1.213 ms] -5.974 ms (-84.0%)
profiling 2.466 ms [2.368 ms, 2.564 ms] -4.645 ms (-65.3%)
tracing 11.099 ms [11.015 ms, 11.183 ms] 3.989 ms (56.1%)
  • candidate results
Variant Request duration [CI 0.99] Δ no_agent
no_agent 12.506 ms [12.394 ms, 12.618 ms] -
appsec 71.713 ms [70.774 ms, 72.652 ms] 59.207 ms (473.4%)
code_origins 87.42 ms [85.992 ms, 88.847 ms] 74.913 ms (599.0%)
iast 80.062 ms [78.962 ms, 81.163 ms] 67.556 ms (540.2%)
profiling 62.461 ms [61.618 ms, 63.303 ms] 49.954 ms (399.4%)
tracing 52.409 ms [51.627 ms, 53.191 ms] 39.903 ms (319.1%)

Dacapo

@mcculls mcculls merged commit 1a9af7b into master Jun 12, 2025
508 of 516 checks passed
@mcculls mcculls deleted the mcculls/always-call-system-gc-in-awaitgc branch June 12, 2025 14:41
@github-actions github-actions bot added this to the 1.50.0 milestone Jun 12, 2025
@PerfectSlayer PerfectSlayer added the tag: no release notes Changes to exclude from release notes label Jun 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: no release notes Changes to exclude from release notes type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants