RFR: 8366781: Parallel: Include OS free memory in GC selection heuristics [v5]

Guoxiong Li gli at openjdk.org
Wed Oct 22 08:47:26 UTC 2025


On Tue, 21 Oct 2025 09:31:32 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Add a new condition checking if OS has enough free memory to commit/expand old-gen, which determines whether the upcoming GC should be young or full.
>> 
>> This is needed only when `UseAdaptiveSizePolicy` is on, because this is intended to avoid including extra OS-time in gc-pause-time tracking, used for young-gen resizing.
>> 
>> Test: tier1-3
>
> 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 10 additional commits since the last revision:
> 
>  - review
>  - Merge branch 'master' into pgc-os-free-mem
>  - Merge branch 'master' into pgc-os-free-mem
>  - review
>  - sizet
>  - Merge branch 'master' into pgc-os-free-mem
>  - Merge branch 'master' into pgc-os-free-mem
>  - review
>  - Merge branch 'master' into pgc-os-free-mem
>  - pgc-os-free-mem

Looks good.

src/hotspot/share/gc/parallel/psScavenge.cpp line 525:

> 523: bool PSScavenge::should_attempt_scavenge() {
> 524:   const bool ShouldRunYoungGC = true;
> 525:   const bool ShouldRunFullGC = false;

According to the code style document `Constant names may be upper-case or mixed-case`, the previous and current names are good.

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

Marked as reviewed by gli (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/27068#pullrequestreview-3364352552
PR Review Comment: https://git.openjdk.org/jdk/pull/27068#discussion_r2450950425


More information about the hotspot-gc-dev mailing list