RFR: 8263387: G1GarbageCollection JFR event gets gc phase, not gc type

Ivan Walulya iwalulya at openjdk.java.net
Fri Mar 12 14:19:08 UTC 2021


On Fri, 12 Mar 2021 08:23:07 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> 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

src/hotspot/share/gc/g1/g1Trace.hpp line 42:

> 40: 
> 41:   void initialize();
> 42:   void report_yc_pause(G1GCPauseType pause);

rename report_yc_pause  to match GCPauseType

-------------

PR: https://git.openjdk.java.net/jdk/pull/2960



More information about the hotspot-gc-dev mailing list