Skip to content

Conversation

egahlin
Copy link
Member

@egahlin egahlin commented Sep 4, 2025

Could I have a review of a PR that fixes the 'jfr gc view' when using ZGC?

The problem is that jdk.YoungGarbageCollection and jdk.OldGarbageCollection events are not used with ZGC. Instead, jdk.ZYoungGarbageCollection and jdk.ZOldGarbageCollection are used.

Before:
$ jfr view gc recording.jfr

                          Garbage Collections

Start    GC ID Type                  Heap Before GC Heap After GC Longest Pause
-------- ----- --------------------- -------------- ------------- -------------
16:13:43     0 Unknown                     868.0 MB        1.6 GB    0.00808 ms
16:13:43     1 Unknown                       1.7 GB        3.8 GB    0.00796 ms
16:13:44     2 Unknown                       3.8 GB        9.0 GB     0.0136 ms
16:13:45     3 Unknown                       6.6 GB        9.0 GB     0.0203 ms
16:13:46     4 Unknown                       9.0 GB        9.0 GB    0.00867 ms
16:13:48     5 Unknown                       9.0 GB        9.0 GB    0.00775 ms

After:
$ jfr view gc recording.jfr

                                   Garbage Collections

Start    GC ID Type                         Heap Before GC Heap After GC Longest Pause
-------- ----- ---------------------------- -------------- ------------- -------------
16:13:43     0 ZGC Old Garbage Collection         868.0 MB        1.6 GB    0.00808 ms
16:13:43     1 ZGC Old Garbage Collection           1.7 GB        3.8 GB    0.00796 ms
16:13:44     2 ZGC Old Garbage Collection           3.8 GB        9.0 GB     0.0136 ms
16:13:45     3 ZGC Young Garbage Collection         6.6 GB        9.0 GB     0.0203 ms
16:13:46     4 ZGC Young Garbage Collection         9.0 GB        9.0 GB    0.00867 ms
16:13:48     5 ZGC Young Garbage Collection         9.0 GB        9.0 GB    0.00775 ms

Note: "Unknown" can still occur if not all events for a GC ID have been emitted.

I also made a change so that GCs are now ordered according to GC ID. This prevents issues where entries with a start time of N/A appear first in cases where not all events are emitted for a GC cycle.

Testing: jdk/jdk/jfr + manual inspection with ZGC, G1, Parallel and Serial.

Thanks
Erik


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8366896: JFR: Add gc view support for ZGC (Bug - P3)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27099/head:pull/27099
$ git checkout pull/27099

Update a local copy of the PR:
$ git checkout pull/27099
$ git pull https://git.openjdk.org/jdk.git pull/27099/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 27099

View PR using the GUI difftool:
$ git pr show -t 27099

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27099.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 4, 2025

👋 Welcome back egahlin! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 4, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Sep 4, 2025

@egahlin The following label will be automatically applied to this pull request:

  • hotspot-jfr

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@egahlin egahlin marked this pull request as ready for review September 4, 2025 14:51
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 4, 2025
@mlbridge
Copy link

mlbridge bot commented Sep 4, 2025

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot-jfr [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

1 participant