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

Aditya Mandaleeka adityam at openjdk.java.net
Wed Jun 2 19:48:07 UTC 2021


On Wed, 2 Jun 2021 14:46:19 GMT, Stefan Johansson <sjohanss at openjdk.org> wrote:

>>>> Another option is to disable preventive gcs for this case, which is probably the safer bet - I can imagine that in some cases this change would prevent the evacuation failures necessary for the test to complete successfully (to actually do an evacuation failure).
>> 
>>> I think this sounds like a good approach. If we test to get evac failures it is reasonable to turn of "preventive" GCs.
>> 
>> Yup. I'll revert the test change that was made in the original PR and instead disable preventive collections for `GCTestWithEvacuationFailure`.
>> 
>>> A "preventive" Full GC looks a bit strange to me, I mean the Full GC occurs because we failed not prevent it. So I think we should avoid using this GC cause for Full collections. What do others think?
>> 
>> I think you're right, this cause can be confusing when it's on a full collection. The question then is where to switch the cause, and what to switch it to. The problem is that we don't know at the point the cause is set what kind of collection will end up happening. We may decide to upgrade to a full collection in `G1CollectedHeap::do_collection_pause_at_safepoint` or in `satisfy_failed_allocation_helper`. We could put a check in `do_full_collection` that checks if the cause is preventive collection and changes it (to Allocation Failure? something else?), but that seems a bit clunky. Stefan/Thomas, do you have any suggestions?
>
>> I think you're right, this cause can be confusing when it's on a full collection. The question then is where to switch the cause, and what to switch it to. The problem is that we don't know at the point the cause is set what kind of collection will end up happening. We may decide to upgrade to a full collection in `G1CollectedHeap::do_collection_pause_at_safepoint` or in `satisfy_failed_allocation_helper`. We could put a check in `do_full_collection` that checks if the cause is preventive collection and changes it (to Allocation Failure? something else?), but that seems a bit clunky. Stefan/Thomas, do you have any suggestions?
> 
> We discussed this a bit today and the general idea is that we should change the GC-cause for upgraded GCs to something better and more descriptive. We can do that outside this change, either before or after. I filed [JDK-8268122](https://bugs.openjdk.java.net/browse/JDK-8268122) and will look into this.

@kstefanj Sounds great, thanks. I've pushed the change to disable preventive GC for the evac failure test (and undid the other test changes that were done in the original PR).

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

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


More information about the hotspot-gc-dev mailing list