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

Albert Mingkun Yang ayang at openjdk.org
Fri Oct 17 14:30:03 UTC 2025


On Wed, 8 Oct 2025 11:56:25 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 six additional commits since the last revision:
> 
>  - 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

> The method PSScavenge::should_attempt_scavenge only judges whether it should run young GC...

True, that's why I find that using a named bool is more explicit, especially now that this method is growing slightly lengthier.


bool PSScavenge::should_attempt_scavenge() {
  const static bool SHOULD_RUN_YOUNG_GC = true;

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

PR Review: https://git.openjdk.org/jdk/pull/27068#pullrequestreview-3350610759


More information about the hotspot-gc-dev mailing list