RFR: JDK-8284758: [linux] improve print_container_info [v2]

Thomas Stuefe stuefe at openjdk.java.net
Wed Apr 13 16:11:16 UTC 2022


On Wed, 13 Apr 2022 16:05:09 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   adjust print_container_helper
>
> src/hotspot/os/linux/os_linux.cpp line 2191:
> 
>> 2189:   st->print("%s: ", metrics);
>> 2190:   if (j > 0) {
>> 2191:     st->print_cr(UINT64_FORMAT " k", uint64_t(j) / 1024);
> 
> Shouldn't this check whether or not `j >= 1024` before doing the division? I'm thinking:
> 
> if (j > 0) {
>     if (j >= 1024) {
>        st->print_cr(UINT64_FORMAT " k", uint64_t(j) / 1024);
>    } else {
>       st->print_cr(UINT64_FORMAT, uint64_t(j));
>    }

Aren't these sizes page-aligned anyway?

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

PR: https://git.openjdk.java.net/jdk/pull/8217


More information about the hotspot-runtime-dev mailing list