RFR: 8367485: os::physical_memory is broken in 32-bit JVMs when running on 64-bit OSes [v2]
Anton Artemov
duke at openjdk.org
Thu Sep 18 12:51:39 UTC 2025
> 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 `uint64_t`.
>
> Tested in tiers 1 - 5.
Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
8367485: Refactoring with uint64_t
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/27335/files
- new: https://git.openjdk.org/jdk/pull/27335/files/8effef43..8e91019c
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=27335&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=27335&range=00-01
Stats: 121 lines in 19 files changed: 0 ins; 7 del; 114 mod
Patch: https://git.openjdk.org/jdk/pull/27335.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27335/head:pull/27335
PR: https://git.openjdk.org/jdk/pull/27335
More information about the hotspot-runtime-dev
mailing list