RFR: 8270014: Add scoped objects for g1 young gc verification and young gc internal timing [v2]

Thomas Schatzl tschatzl at openjdk.java.net
Wed Jul 14 07:48:12 UTC 2021

On Tue, 13 Jul 2021 18:15:57 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
>>   Fix test because of slightly different log message order
> src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp line 522:
>> 520: 
>> 521: void G1GCPhaseTimes::print() {
>> 522:   if (_cur_verify_before_time_ms > 0.0) {
> Is this `if` just checking whether verification is enabled or not? If so, can `VerifyBeforeGC` be used? Otherwise, it's unclear to me why we are comparing it with `0.0`.

The `if` checks whether any verification work has been done (it will be > 0.0 if it has been set) in this pause. We can't just use `VerifyBefore/AfterGC` because verification before/after does not always run for all young gc pauses (see `VerifyGCType`).
If we want to change this (existing) behavior to like always print the time if the flag is enabled I would suggest to file another CR instead of hiding it here (I can do all that and the associated work if that is desired).


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

More information about the hotspot-gc-dev mailing list