8017163: minor question regarding the calculation and logging of card set coarsening statistics
Thomas Schatzl
thomas.schatzl at oracle.com
Tue May 31 09:06:04 UTC 2022
Hi,
first, apologies for the late answer - I've been on vacation last
week and then forgot a bit about this.
On 26.05.22 18:05, Tianqi Xia wrote:
> Hi,
>
> One more observation on how the coarsening statistics are printed.
>
> Right now coarsening stats are printed 3 times during a GC cycle: >
> The first one happens when G1HeapPrinterMark is constructed, this one
> obtains its data from the _coarsenings field of G1RemSetSummary, and it
> covers the coarsening stats from the end of last GC cycle to the
> beginning of current GC cycle.
>
> The second one happens when G1HeapPrinterMark is destructed, its source
> is the _coarsen_stats and _last_coarsen_stats fields of G1CardSet, and
> covers coarsening stats from the end of last GC cycle to the end of
> current GC cycle, with both recent- and all- statistics.
>
> The third printing happens immediately after the second one, its source
> is again the _coarsenings field of G1RemSetSummary, and it covers the
> coarsening stats from the beginning of current GC cycle to the end of
> current GC cycle.
>
> Based on testing results of BigRamTester and some other benchmarks, data
> displayed by the first one and the second one are almost identical,
> despite the fact that the second one is more verbose, and in most cases
> the third one just displays a bunch of zeros.
The first one should always be a copy of the "Coarsening (recent)"
statistics (at least with G1SummarizeRSetStatsPeriod=1).
The third one should always print zeros - gc does not (and should not)
add any references directly to the remembered set.
> Is it possible to just keep the second one and remove others? This
> change can keep the logging of coarsening stats more concise, and save
> the effort of maintaining a copy of these data in G1RemSetSummary. >
> I understand there is nothing wrong with the current implementation,
> just some thoughts to make the code a little bit cleaner.
I am fine with that although it looses a bit of information with
G1SummarizeRSetStatsPeriod > 1.
I filed https://bugs.openjdk.java.net/browse/JDK-8287558.
Thanks,
Thomas
More information about the hotspot-gc-dev
mailing list