RFR: 8354555: Add generic JFR events for TaskTerminator [v4]
Xiaolong Peng
xpeng at openjdk.org
Fri May 23 17:05:08 UTC 2025
> The purpose of the PR is to add generic JFR events for TaskTerminator to track the attempts and timings that GC threads have tried to terminate GC tasks.
>
> Today only G1 emits JFR event with name `Termination` from [G1ParEvacuateFollowersClosure](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/g1/g1YoungCollector.cpp#L555-L563), all other garbage collectors don't emit any JFR event for the termination attempt at all.
>
> By adding this, it gives performance engineers the visibility to the termination attempts and termination time when GC threads trying to finish GC tasks, we could build tool to analyze the jfr events to determine if there is potential data structure issue in application code, e.g. very large LinkedList or LinkedBlockingQueue.
>
> For the test, I have manually tested different GCs with Flight Recording enabled and verified the events:
> G1:
>
> jdk.GCPhaseParallel {
> startTime = 23:09:34.124 (2025-05-22)
> duration = 0.0108 ms
> gcId = 0
> gcWorkerId = 8
> name = "Termination"
> eventThread = "GC Thread#4" (osThreadId = 20483)
> }
>
> jdk.GCPhaseParallel {
> startTime = 23:09:34.124 (2025-05-22)
> duration = 0.0467 ms
> gcId = 0
> gcWorkerId = 2
> name = "Termination"
> eventThread = "GC Thread#2" (osThreadId = 21251)
> }
>
> jdk.GCPhaseParallel {
> startTime = 23:09:34.124 (2025-05-22)
> duration = 0.0474 ms
> gcId = 0
> gcWorkerId = 1
> name = "Termination"
> eventThread = "GC Thread#8" (osThreadId = 36359)
> }
> jdk.GCPhaseParallel {
> startTime = 23:09:41.925 (2025-05-22)
> duration = 0.000834 ms
> gcId = 14
> gcWorkerId = 7
> name = "Termination: Parallel Marking"
> eventThread = "GC Thread#1" (osThreadId = 21507)
> }
>
> jdk.GCPhaseParallel {
> startTime = 23:09:41.925 (2025-05-22)
> duration = 0.000166 ms
> gcId = 14
> gcWorkerId = 7
> name = "Termination: Parallel Marking"
> eventThread = "GC Thread#1" (osThreadId = 21507)
> }
>
>
> Shenandoah:
>
> jdk.GCPhaseParallel {
> startTime = 23:39:58.890 (2025-05-22)
> duration = 0.0202 ms
> gcId = 0
> gcWorkerId = 0
> name = "Termination: Concurrent Mark"
> eventThread = "Shenandoah GC Threads#3" (osThreadId = 13827)
> }
>
> jdk.GCPhaseParallel {
> startTime = 23:39:58.890 (2025-05-22)
> duration = 0.0205 ms
> gcId = 0
> gcWorkerId = 1
> name = "Termination: Concurrent Mark"
> eventThread = "Shenandoah GC Threads#1" (osThreadId = 14339)
> }
>
> jdk.GCPhaseParallel {
> startTime = 23:39:58.890 (2025-05-22)
> duration = 0.0127 ms
> gcId = 0
> gcWorkerId = 5
> name = "Termination: Final Mark"
> eventThread = "Shenandoah G...
Xiaolong Peng has updated the pull request incrementally with one additional commit since the last revision:
Fix jft test failure
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24676/files
- new: https://git.openjdk.org/jdk/pull/24676/files/5ab1c5fc..fe671499
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24676&range=03
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24676&range=02-03
Stats: 4 lines in 1 file changed: 3 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/24676.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24676/head:pull/24676
PR: https://git.openjdk.org/jdk/pull/24676
More information about the hotspot-dev
mailing list