RFR: 8252645: Change time measurements in G1ServiceThread to only account remembered set work

Thomas Schatzl tschatzl at openjdk.java.net
Thu Nov 26 16:30:58 UTC 2020


On Thu, 26 Nov 2020 10:35:35 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

> Please review this change to move the timing of how much time is spent doing remembered set sampling into the task doing the sampling. The timing has historically been part of the service thread, because in the past the only thing the thread did was sampling. Now when both uncommit work and periodic GC scheduling has been added, the timing needs to be moved into the sampling task.
> 
> I've also slightly changed the output using this information to:
> [0,295s][trace][gc,remset   ] GC(0)   Sampling task time (ms)
> [0,295s][trace][gc,remset   ] GC(0)           0,000
> Instead of the old:
> [0,301s][trace][gc,remset   ] GC(0)   Service thread time (s)
> [0,301s][trace][gc,remset   ] GC(0)           0,00
> 
> I decided to change the unit to ms because the time spent doing sampling is very small and is better measured in milliseconds. When doing so I also went with three decimals since this is what we normally do for milliseconds.

Looks good apart from these minor nits.

Marked as reviewed by tschatzl (Reviewer).

src/hotspot/share/gc/g1/g1RemSet.cpp line 485:

> 483: };
> 484: 
> 485: G1RemSet::G1RemSet(G1CollectedHeap* g1h,

Not completely sure why this moved but not `G1RemSet::initialize()` below.

src/hotspot/share/gc/g1/g1RemSet.cpp line 634:

> 632:   return _sampling_task->vtime_accum();
> 633: }
> 634: 

Extra newline.

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

Marked as reviewed by tschatzl (Reviewer).

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



More information about the hotspot-gc-dev mailing list