RFR: 8364518: Support for Job Objects in os::commit_memory_limit() on Windows [v2]
Joel Sikström
jsikstro at openjdk.org
Tue Aug 5 08:27:04 UTC 2025
On Tue, 5 Aug 2025 06:45:50 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Print error message if query fails
>
> src/hotspot/os/windows/os_windows.cpp line 3321:
>
>> 3319:
>> 3320: // No limit
>> 3321: return SIZE_MAX;
>
> Shouldn't we fallback to using ` GlobalMemoryStatusEx` if we are not part of a Job?
In [https://github.com/openjdk/jdk/pull/26530 ](https://github.com/openjdk/jdk/pull/26530) (concerning the implementation of os::commit_memory_limit and os::reserve_memory_limit), we return SIZE_MAX to indicate that there is no limit imposed by the user or system. We could potentially fall back to using `GlobalMemoryStatusEx`, which may be more accurate than returning SIZE_MAX. However, I think it is rare that there is a practical difference between using SIZE_MAX and the size of the available virtual address space, since both are typically very large values. If you or others feel strongly about falling back to reporting the size of available virtual address space from `GlobalMemoryStatusEx`, I’m open to that approach.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26593#discussion_r2253538357
More information about the hotspot-gc-dev
mailing list