RFR: 8254739: G1: Optimize evacuation failure for regions with few failed objects [v19]

Hamlin Li mli at openjdk.java.net
Fri Nov 5 10:38:13 UTC 2021

On Fri, 5 Nov 2021 09:39:46 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
>>   Move allocation/deallocation in one place
> src/hotspot/share/gc/g1/g1EvacFailureObjectsSet.cpp line 131:
>> 129: 
>> 130:   _offsets.drop_all();
>> 131: }
> Having some destructive operations (`drop_all`) inside a method named `iterate` could come as a surprise, IMO. If I understand this correctly, the following would be problematic.
> evac_failed_objects.iterate(closure1);
> ...
> evac_failed_objects.iterate(closure2);

drop_all just returns buffers to free list, it will not destruct the buffers. So, iterate multiple times is OK, because next time it will get memory from free list or allocate a new buffer. Hope this answer your question.


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

More information about the hotspot-gc-dev mailing list