RFR: 8269022: Put evacuation failure string directly into gc=info log message

Thomas Schatzl tschatzl at openjdk.java.net
Wed Jun 30 11:02:05 UTC 2021


On Wed, 30 Jun 2021 10:05:29 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:

>> Hi all,
>> 
>>   can I have reviews for this change that puts the evacuation failure marker from a separate log line into the GC timing message. I.e. instead of
>> 
>> 
>> Pause Young (Normal) (G1 Evacuation Pause)
>> To-space exhausted
>> 
>> into
>> 
>> 
>> Pause Young (Normal) (Evacuation Failure) (G1 Evacuation Pause) 
>> 
>> 
>> This is imho easier to read, better to process and less wasteful with log space.
>> 
>> Testing: tier1, gc/g1 tests
>
> src/hotspot/share/gc/g1/g1CollectedHeap.cpp line 2938:
> 
>> 2936:   ~G1YoungGCTraceTime() {
>> 2937:     update_young_gc_name();
>> 2938:   }
> 
> Do I understand correctly that we update the name in _young_gc_name_data in the destructor, and then depend on that _tt does not  copy that value earlier --- only the pointer? This seems quite fragile if GCTraceTimeWrapper would change, and I think would at least warrant a comment in the constructor that the string *will* be updated in the destructor.

Added. Note that the previous code also had that assumption, this is why the `young_gc_name` array needed to be alive the whole method.
The added test will detect if it does not work any more.

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

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


More information about the hotspot-gc-dev mailing list