RFR: JDK-8284758: [linux] improve print_container_info

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


On Wed, 13 Apr 2022 08:20:20 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> Currently on Linux, os::Linux::print_container_info might print rather badly unreadable memory infos like :
> 
> memory_usage_in_bytes: 18029760512
> memory_max_usage_in_bytes: 423686144
> 
> This could be improved , at a lot of places in the hs_err file output we already print the larger memory-related infos in k , for example rlimit information
> or /proc/meminfo.

This looks fine. These numbers are probably all page aligned, so rounding to kb would never loose precision.

Cheers, Thomas

src/hotspot/os/linux/os_linux.cpp line 2189:

> 2187: 
> 2188: static void print_container_helper(outputStream* st, jlong j, const char* header) {
> 2189:   st->print("%s", header);

Small nit: I' d probably add ": " here and remove those out of the caller arguments.

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

Marked as reviewed by stuefe (Reviewer).

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


More information about the hotspot-runtime-dev mailing list