RFR: 8371408: [Linux] VM.info output for container information is confusing [v3]

Casper Norrbin cnorrbin at openjdk.org
Fri Dec 12 11:59:33 UTC 2025


> Hi everyone,
> 
> The current `VM.info` printout for container limits can be made clearer and easier to read. The original formatting was designed around cgroup v1, directly mirroring its file names and conventions. Since then, most environments have transitioned to cgroup v2. While the output is still correct, its readability suffers. For example, memory metrics have a `_in_bytes` suffix, but the printed values are actually in kilobytes with a `k` suffix.
> 
> This PR removes the `_in_*` suffixes from metric names and adds appropriate units (e.g. `kB`, `us`) directly to the values. At the same time, I have also improved the formatting of the output so that all values and units are column-aligned, similar to the `/proc/meminfo` section immediately above in the `VM.info` printout.
> 
> 
> Here is the container printout before:
> 
> container (cgroup) information:
> container_type: cgroupv1
> cpu_cpuset_cpus: 0-15
> cpu_memory_nodes: 0-1
> active_processor_count: 16, but overridden by -XX:ActiveProcessorCount 8
> cpu_quota: 1600000
> cpu_period: 100000
> cpu_shares: no shares
> cpu_usage_in_micros: 2648091
> memory_limit_in_bytes: 4194304 k
> memory_and_swap_limit_in_bytes: 8388608 k
> memory_soft_limit_in_bytes: unlimited
> memory_throttle_limit_in_bytes: unavailable
> memory_usage_in_bytes: 61116 k
> memory_max_usage_in_bytes: 61116 k
> rss_usage_in_bytes: 56332 k
> cache_usage_in_bytes: 1880 k
> kernel_memory_limit_in_bytes: unlimited
> kernel_memory_usage_in_bytes: 1584 k
> kernel_memory_max_usage_in_bytes: 1644 k
> maximum number of tasks: unlimited
> current number of tasks: 17
> 
> 
> And here it is after:
> 
> container (cgroup) information:
> container_type:               cgroupv1
> cpu_cpuset_cpus:                  0-15
> cpu_memory_nodes:                  0-1
> active_processor_count:              8 (from -XX:ActiveProcessorCount)
> cpu_quota:                     1600000
> cpu_period:                     100000
> cpu_shares:                  no shares
> cpu_usage:                     2648091 us
> memory_limit:                  4194304 kB
> memory_and_swap_limit:         8388608 kB
> memory_soft_limit:           unlimited
> memory_throttle_limit:     unavailable
> memory_usage:                    61116 kB
> memory_max_usage:                61116 kB
> rss_usage:                       56332 kB
> cache_usage:                      1880 kB
> kernel_memory_limit:         unlimited
> kernel_memory_usage:              1584 kB
> kernel_memory_max_usage:          1644 kB
> maximum number of tasks:     unlimited
> current number of tasks:            17
> 
> 
> To accomplish ...

Casper Norrbin has updated the pull request incrementally with one additional commit since the last revision:

  split unit print

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28766/files
  - new: https://git.openjdk.org/jdk/pull/28766/files/e88713c7..ccb7dc48

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28766&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28766&range=01-02

  Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/28766.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28766/head:pull/28766

PR: https://git.openjdk.org/jdk/pull/28766


More information about the hotspot-runtime-dev mailing list