RFR: 8367485: os::physical_memory is broken in 32-bit JVMs when running on 64-bit OSes [v6]
Anton Artemov
duke at openjdk.org
Thu Sep 18 15:08:39 UTC 2025
On Thu, 18 Sep 2025 14:59:21 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:
>> Anton Artemov has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8367485: Addressed reviewers' comments.
>
> src/hotspot/share/gc/shared/gcInitLogger.cpp line 66:
>
>> 64: void GCInitLogger::print_memory() {
>> 65: uint64_t memory = os::physical_memory();
>> 66: log_info_p(gc, init)("Memory: " UINT64_FORMAT, memory);
>
> I don't think this is alright. We should just revert this to what it was before [JDK-8357086](https://bugs.openjdk.org/browse/JDK-8357086), with UINT64_FORMAT instead.
>
> log_info_p(gc, init)("Memory: " UINT64_FORMAT "%s",
> byte_size_in_proper_unit(memory), proper_unit_for_byte_size(memory));
>
>
> Right now it looks like this:
>
> [0.007s][info][gc,init] Memory: 38654705664
>
> When it previously looked like this:
>
> [0.023s][info][gc,init] Memory: 36864M
Right, `UINT64_FORMAT` has nothing to do with units. Thanks!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27335#discussion_r2359778976
More information about the hotspot-runtime-dev
mailing list