JDK-8300119 : CgroupMetrics.getTotalMemorySize0() can report invalid results on 32 bit systems
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86
  • Submitted: 2023-01-13
  • Updated: 2023-01-13
Related Reports
Relates :  
Description
JDK-8292541 introduced JNI method Java_jdk_internal_platform_CgroupMetrics_getTotalMemorySize0. During the effort to backport it to jdk8u-dev, We have discovered that it can return an invalid value on x86 (32 bit) systems.

On a system with 7281311744 bytes of total memory the function would return: -1308622848 suggesting some overflow occurring.

This was caught with the tier1 test:
TestMemoryAwareness.testContainerMemExceedsPhysical.

See this discussion on GitHub for further details
https://github.com/openjdk/jdk8u-dev/pull/220#pullrequestreview-1247595245
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk8u-dev/pull/220 Date: 2023-01-03 11:46:29 +0000
13-01-2023