RFR: 8308507: G1: GClocker induced GCs can starve threads requiring memory leading to OOME [v4]

Albert Mingkun Yang ayang at openjdk.org
Thu Jun 1 12:11:11 UTC 2023


On Thu, 1 Jun 2023 09:46:58 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1CollectedHeap.hpp line 224:
>> 
>>> 222:   Mutex _alloc_request_lock;
>>> 223:   DoublyLinkedList<StalledAllocReq> _stalled_allocations;
>>> 224:   DoublyLinkedList<StalledAllocReq> _satisfied_allocations;
>> 
>> Not super obvious to me why two lists are needed since each element has `state` already. Can they be merged into one? Then, one can avoid the list manipulation in the following example.
>> 
>> 
>>     alloc_req->set_state(StalledAllocReq::AllocationState::Success, result);
>>     ...
>>     // Move the allocation request from stalled to satisfied list.
>>     _stalled_allocations.remove(alloc_req);
>>     _satisfied_allocations.insert_last(alloc_req);
>
> I thought it would be easier to follow with the two lists. I can merge them, If that is easier.

I think it's the `state` that determines how element should be processed, regardless which list it lives on. If so, merging them sounds simpler. Could you try and see which approach is shorter/clearer/easier?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/14077#discussion_r1213053912


More information about the hotspot-gc-dev mailing list