RFR: 8354431: gc/logging/TestGCId fails on Shenandoah
Xiaolong Peng
xpeng at openjdk.org
Thu Apr 24 22:47:28 UTC 2025
I can't reproduce the issue in Linux, but based on the gc log share in JBS bug and the related code, it is easy to find the root cause of it.
[0.133s][info][gc] GC(0) Concurrent reset after collect (unload classes) 0.033ms
[0.135s][info][gc] Trigger: Learning 2 of 5. Free (3958K) is below initial threshold (7167K)
[0.135s][info][gc] Failed to allocate Shared, 128K
[0.137s][info][gc] Trigger: Handle Allocation Failure
[0.148s][info][gc] GC(2) Degenerated GC upgrading to Full GC
[0.167s][info][gc] GC(2) Pause Degenerated GC (Outside of Cycle) 5M->1M(10M) 30.323ms
At 0.135s, a concurrent cycle was triggered: `[0.135s][info][gc] Trigger: Learning 2 of 5.`, meanwhile there was allocation failure causing degen: `[0.135s][info][gc] Failed to allocate Shared, 128K`.
In the implementation of ShenandoahControlThread::service_concurrent_normal_cycle, it checks if there degen or cancellation before starting the concurrent cycle and return w/o any gc log, which causes the missing GCID 1 in the GC log.
Since technically it is not a bug, to fix the potential failure of test `gc/logging/TestGCId` I'll add one line code to print GC log like "[0.135s][info][gc] GC(1) Cancelled"
### Test
- [x] gc/logging/TestGCId
- [x] hotspot_gc_shenandoah
-------------
Commit messages:
- 8354431: gc/logging/TestGCId fails on Shenandoah
Changes: https://git.openjdk.org/jdk/pull/24856/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24856&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8354431
Stats: 4 lines in 1 file changed: 3 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/24856.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24856/head:pull/24856
PR: https://git.openjdk.org/jdk/pull/24856
More information about the hotspot-gc-dev
mailing list