RFR: 8334445: Parallel: Decouple maximum compaction from SoftReference clearing [v3]

Zhengyu Gu zgu at openjdk.org
Wed Jul 3 15:45:23 UTC 2024


On Wed, 3 Jul 2024 15:39:44 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> src/hotspot/share/gc/parallel/psParallelCompact.cpp line 975:
>> 
>>> 973:   ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
>>> 974:   clear_all_soft_refs = clear_all_soft_refs
>>> 975:                      || heap->soft_ref_policy()->should_clear_all_soft_refs();
>> 
>> In `ParallelScavengeHeap::failed_mem_allocate()`, it does 
>> 
>> ```do_full_collection(clear_all_soft_refs = false);
>>      ....
>>      do_full_collection(clear_all_soft_refs = true);
>>      ....
>>      throws OOM
>> 
>> 
>> There is possibility that `do_full_collection(clear_all_soft_refs = false)` cycle clears all soft refs due to soft ref policy. In this case, should we bypass the second `do_full_collection()` and throws OOM immediately?
>
> That seems a potential optimization. Can we defer it to a followup ticket? (I have some other cleanups in this area, which can affect the design decision here.)

Sounds reasonable.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19763#discussion_r1664407122


More information about the hotspot-gc-dev mailing list