Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8300119

CgroupMetrics.getTotalMemorySize0() can report invalid results on 32 bit systems

XMLWordPrintable

        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

              jdowland Jonathan Dowland
              jdowland Jonathan Dowland
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: