RFR: 8297584: G1 parallel phase event for scan heap roots is sent too often
Albert Mingkun Yang
ayang at openjdk.org
Wed Nov 30 14:40:27 UTC 2022
On Fri, 25 Nov 2022 10:19:12 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:
> Please review this enhancement to decrease the number of "GC Phase Parallel" events sent by G1.
>
> **Summary**
> The "GC Phase Parallel" event is used by multiple phases in G1 and for the "ScanHR" phase we currently get an excessive amount of events. In a recent recording of mine more then 75% of these events was of the "ScanHR" type. This event is sent from more than one place in the code and one reason for the excessive amount is that we send the event on a per region basis rather than once per worker.
>
> The fix is to move where we send the event so instead of sending it inside `scan_heap_roots(HeapRegion* r)` in the closure we send it in the outer `scan_heap_roots(...)`. So instead of sending it once per region we send it once per worker. The way the event is sent is still not optimal because it will include a bit more than what the name suggests (but that was true before as well).
>
> I also move the other place where this event was sent to make it more consistent with the "Code Roots" events sent by the same closure.
>
> **Testing**
> * Local JFR testing and verification that we get a lower number of events.
> * Mach5 testing of JFR.
Marked as reviewed by ayang (Reviewer).
-------------
PR: https://git.openjdk.org/jdk/pull/11362
More information about the hotspot-gc-dev
mailing list