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

Zhengyu Gu zgu at openjdk.org
Wed Jul 3 14:30:22 UTC 2024


On Tue, 2 Jul 2024 09:05:33 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Simple refactoring to not assume maximum-compaction from soft-ref-clearing.
>
> 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?

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

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


More information about the hotspot-gc-dev mailing list