RFR: 8292083: Detected container memory limit may exceed physical machine memory [v3]

Severin Gehwolf sgehwolf at openjdk.org
Wed Aug 17 14:40:20 UTC 2022


On Wed, 17 Aug 2022 13:35:10 GMT, Jonathan Dowland <jdowland at openjdk.org> wrote:

> > Anyway, we could perhaps write a WhiteBox based one which asserts that the os::physical_memory() never exceeds the host memory. See WhiteBox.printOsInfo() for an example as to how that's done.
> 
> Do you mean as well as, or instead of, the `OperatingSystemMXBean` approach I've currently taken? (I'm aware it's a bit of a smell. I did test preliminary backports to 11u and 8u, and this is one area that isn't clean)

Instead of. OperatingSystemMXBean itself would return the container value but depends on the Java lib code. A cleaner way would be to just use `WhiteBox.physicalMemory()` or some such.
 
> Looking at `printOsInfo`: is your suggestion to call that and inspect the output, or extend `WhiteBox` itself with a physical memory limit method? I lean towards the latter

The latter.

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

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


More information about the hotspot-runtime-dev mailing list