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

Albert Mingkun Yang ayang at openjdk.org
Mon Oct 27 09:55:34 UTC 2025


On Fri, 24 Oct 2025 14:33:28 GMT, Ivan Walulya <iwalulya 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 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
>
> src/hotspot/share/gc/parallel/psScavenge.cpp line 562:
> 
>> 560:     uint64_t free_mem_in_os;
>> 561:     if (os::free_memory(free_mem_in_os)) {
>> 562:       size_t actual_free = (size_t)MIN2(old_gen->committed().byte_size() - old_gen->used_in_bytes() + free_mem_in_os,
> 
> Suggestion:
> 
>       uint64_t actual_free = old_gen->committed().byte_size() - old_gen->used_in_bytes() + free_mem_in_os;
> 
> 
> with associated changes to the log, probably would have been easier to read

The long-term plan is to use `size_t` in `os::free_memory` as well, so I prefer limiting the scope of `uint64_t`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27068#discussion_r2465045547


More information about the hotspot-gc-dev mailing list