RFR: 8257774: G1: Trigger collect when free region count drops below threshold to prevent evacuation failures [v5]

Aditya Mandaleeka adityam at openjdk.java.net
Mon May 3 22:30:51 UTC 2021


On Fri, 30 Apr 2021 12:29:33 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>> Aditya Mandaleeka has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove temp comment.
>
> src/hotspot/share/gc/g1/g1Policy.cpp line 1422:
> 
>> 1420:   }
>> 1421: 
>> 1422:   if (_g1h->young_regions_count() == 0 && _collection_set->candidates() != NULL && _collection_set->candidates()->is_empty()) {
> 
> Add a comment that we have no regions to collect. Adding a `has_candidates()` to `G1CollectionSet` seems to make sense now when we check for candidates a couple of times and will make this condition read a bit better as well:
> Suggestion:
> 
>   if (_g1h->young_regions_count() == 0 && !_collection_set->has_candidates()) {
>     // Don't attempt a proactive GC when there are no regions to collect.

Thomas and I talked about this before but decided not to do it because the two cases where we're doing this are doing slightly different things (one is checking for NULL || empty and the other is checking !NULL && empty, which is not the inverse of the first). Looking at it closer now though, I think this one should also be bailing in the case where candidates is NULL right? If we do that, we can definitely add the has_candidates function and use that in both cases.

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

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



More information about the hotspot-gc-dev mailing list