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

Albert Mingkun Yang ayang at openjdk.java.net
Tue Jul 13 18:25:09 UTC 2021


On Tue, 13 Jul 2021 16:07:23 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Hi all,
>> 
>>   can I get reviews for some further cleanup of the young collection code:
>> - adding some more scoped objects (verification, gc pause timing)
>> - some naming, minor related code movement
>> 
>> Thanks,
>>   Thomas
>
> 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

Changes requested by ayang (Committer).

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`.

src/hotspot/share/gc/g1/g1Policy.hpp line 305:

> 303: 
> 304:   void note_young_gc_pause_start();
> 305:   void note_young_gc_pause_end();

It's not obvious to me if there's a diff btw `young_gc_pause` and  `young_collection`, or what the diff is. I think having some comments for these two pairs of methods would make it easier to understand.

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

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



More information about the hotspot-gc-dev mailing list