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

Albert Mingkun Yang ayang at openjdk.org
Wed Jul 3 15:42:21 UTC 2024


On Wed, 3 Jul 2024 14:27:23 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

>> Albert Mingkun Yang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - Merge branch 'master' into pgc-max-compact
>>  - Merge branch 'master' into pgc-max-compact
>>  - pgc-max-compact
>
> 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.)

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

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


More information about the hotspot-gc-dev mailing list