RFR: 8258431: Provide a JFR event with live set size estimate [v6]
Jaroslav Bachorik
jbachorik at openjdk.java.net
Mon Mar 1 17:37:12 UTC 2021
On Mon, 22 Feb 2021 17:00:19 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> Jaroslav Bachorik has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Attempt to fix G1 live set size computation
>
> src/hotspot/share/gc/g1/g1ConcurrentMark.cpp line 1114:
>
>> 1112:
>> 1113: _g1h->set_live(live_size * HeapWordSize);
>> 1114:
>
> This code is located in the wrong place. It will return only the live words for the areas that have been marked, not eden or objects allocated in old gen after the marking started.
>
> Further it iterates over all regions, which can be large compared to actually active regions.
>
> A better place is in `G1UpdateRemSetTrackingBeforeRebuild::do_heap_region()` after the last method call - at that point, `HeapRegion::live_bytes()` contains the per-region number of live data for all regions.
>
> `G1UpdateRemSetTrackingBeforeRebuild` is instantiated and then called by multiple threads. It's probably best that that `HeapClosure` locally sums up the live byte estimates and then in the caller `G1UpdateRemSetTrackingBeforeRebuildTask::work()` sums up the per thread results like is done for `G1UpdateRemSetTrackingBeforeRebuildTask::_total_selected_for_rebuild`, which is then set in the caller of the `G1UpdateRemSetTrackingBeforeRebuildTask`.
Would something along the line of https://github.com/openjdk/jdk/pull/2579/commits/08c715abccddbd04ced58706b7a705670843b43a be ok?
-------------
PR: https://git.openjdk.java.net/jdk/pull/2579
More information about the hotspot-gc-dev
mailing list