RFR: 8263387: G1GarbageCollection JFR event gets gc phase, not gc type
Thomas Schatzl
tschatzl at openjdk.java.net
Fri Mar 12 10:29:25 UTC 2021
Hi all,
can I get reviews for this change that fixes some mess-up with JFR events, where the "G1YoungCollection" event should give the name of the current (G1) garbage collection. Currently the code adds a new type that returns the GC phase similar to shown in the tuning guide in [Fig 7-2](https://docs.oracle.com/en/java/javase/15/gctuning/garbage-first-g1-garbage-collector1.html#GUID-F1BE86FA-3EDC-4D4F-BDB4-4B044AD83180). Which might not be as expected, but due to when it's called, the user strings are the usual "Normal" / "Mixed" / "Concurrent Start" that are well-known for pauses.
It also showed that the phase enum we carry around internally has only been used for this purpose, so it can be deleted. While at it, the JFR event can now show the "new" pauses ("Prepare Mixed" and the "Concurrent Start" variants).
There are three commits in this series:
- Initial commit: implements the changes in the current coding style
- Rename file: I renamed `g1GCTypes.hpp` to the now more fitting `g1GCPauseType.hpp`
- enum class changes: where I attempted to turn the C enum `G1GCPauseTypes` into an enum class to make things a bit more c++'y. Not sure if it is a good change, it does not give a lot (apart from less polluting the global namespace a bit), but I left it here to see the opinions of others.
Testing: tier1-5, checked some JFR recordings for the event and its description
Thanks,
Thomas
-------------
Commit messages:
- enum class changes
- Rename file
- Initial commit
Changes: https://git.openjdk.java.net/jdk/pull/2960/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2960&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8263387
Stats: 300 lines in 10 files changed: 115 ins; 127 del; 58 mod
Patch: https://git.openjdk.java.net/jdk/pull/2960.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/2960/head:pull/2960
PR: https://git.openjdk.java.net/jdk/pull/2960
More information about the hotspot-gc-dev
mailing list