RFR: 8367485: os::physical_memory is broken in 32-bit JVMs when running on 64-bit OSes [v14]

duke duke at openjdk.org
Mon Sep 29 08:15:11 UTC 2025


On Fri, 26 Sep 2025 07:32:42 GMT, Anton Artemov <duke at openjdk.org> wrote:

>> Hi, please consider the following changes:
>> 
>> In this PR we address the overflow issue in `os::physical_memory()` on Linux, which can occur when running a 32-bit JVM on a 64-bit machine, introduced by https://bugs.openjdk.org/browse/JDK-8357086. The problem is that the product of _SC_PHYS_PAGES and _SC_PAGESIZE can overflow according to the documentation. 
>> 
>> The issue is addressed by changing the output type of all related functions to `physical_memory_size_type`, which is an alias to `uint64_t`.
>> 
>> Tested in tiers 1 - 5.
>
> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8367485: Fixed typos in the comment.

@toxaart 
Your change (at version 8601871e1101c4ea20f310f72dfe2fe40fdc4cc2) is now ready to be sponsored by a Committer.

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

PR Comment: https://git.openjdk.org/jdk/pull/27335#issuecomment-3345599522


More information about the hotspot-dev mailing list