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

ZGC: Ensure consistent MemoryUsage from MemoryMXBean.getHeapMemoryUsage()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • 20
    • 20
    • hotspot
    • gc
    • b29

    Backports

      Description

        A lot of lowmem tests fails with

        ----------System.out:(63/4598)----------
        Stress time: 300 seconds
        Stress iterations factor: 1
        Stress threads factor: 1
        Stress runs factor: 1
        Max memory: 1038090240
        Sleep time: 500
        Iterations: 0
        Number of threads: 24
        Run GC thread: false
        Run mem diag thread: false
        Run forever: false
        MemoryMonitor > Test mode: access to MBean through MBeanServer
        MemoryMonitor > MBeanServer: DEFAULT
        MemoryMonitor > Memory: mixed (This setting is used in lowmem* tests only)
        MemoryMonitor > Monitoring: polling (This setting is used in lowmem* tests only)
        MemoryMonitor > Threshold: collection (This setting is used in lowmem* tests only)
        MemoryMonitor > Timeout: 30 (This setting is used in lowmem* tests only)
        MemoryMonitor > Changing threshold, pool: java.lang:name=ZHeap,type=MemoryPool, nullnull, new threshold: 204472320
        MemoryMonitor > Collection threshold is set, pool: java.lang:name=ZHeap,type=MemoryPool, usage: init = 8388608(8192K) used = 18874368(18432K) committed = 390070272(380928K) max = 1038090240(1013760K), threshold: 204472320
        Starting Thread[#60,Thread[#36,Thread-2,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#61,Thread[#37,Thread-3,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#62,Thread[#38,Thread-4,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#63,Thread[#39,Thread-5,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#64,Thread[#40,Thread-6,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#65,Thread[#41,Thread-7,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#66,Thread[#42,Thread-8,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#67,Thread[#43,Thread-9,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#68,Thread[#44,Thread-10,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#69,Thread[#45,Thread-11,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#70,Thread[#46,Thread-12,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#71,Thread[#47,Thread-13,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#72,Thread[#48,Thread-14,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#73,Thread[#49,Thread-15,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#74,Thread[#50,Thread-16,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#75,Thread[#51,Thread-17,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#76,Thread[#52,Thread-18,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#77,Thread[#53,Thread-19,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#78,Thread[#54,Thread-20,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#79,Thread[#55,Thread-21,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#80,Thread[#56,Thread-22,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#81,Thread[#57,Thread-23,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#82,Thread[#58,Thread-24,5,MainThreadGroup],5,MainThreadGroup]
        Starting Thread[#83,Thread[#59,Thread-25,5,MainThreadGroup],5,MainThreadGroup]
        Exception in
        Thread[#44,Thread-10,5,MainThreadGroup]
        MemoryMonitor > Crossing is noticed, pool: java.lang:name=ZHeap,type=MemoryPool, usage: init = 8388608(8192K) used = 58720256(57344K) committed = 727711744(710656K) max = 1038090240(1013760K), count: 1
        java.lang.IllegalArgumentException: used = 517996544 should be <= committed = 513802240
        at java.management/java.lang.management.MemoryUsage.<init>(MemoryUsage.java:162)
        at java.management/sun.management.MemoryImpl.getMemoryUsage0(Native Method)
        at java.management/sun.management.MemoryImpl.getHeapMemoryUsage(MemoryImpl.java:72)
        at nsk.monitoring.stress.lowmem.lowmem001$HeapStresser.run(lowmem001.java:162)
        at nsk.share.runner.ThreadsRunner$ManagedThread.run(ThreadsRunner.java:128)
        at java.base/java.lang.Thread.run(Thread.java:1591)
        MemoryMonitor > Changing threshold, pool: java.lang:name=ZHeap,type=MemoryPool, nullnull, new threshold: 620756992
        MemoryMonitor > Collection threshold is set, pool: java.lang:name=ZHeap,type=MemoryPool, usage: init = 8388608(8192K) used = 727711744(710656K) committed = 727711744(710656K) max = 1038090240(1013760K), threshold: 620756992
        Failures summary:
        java.lang.IllegalArgumentException: used = 517996544 should be <= committed = 513802240
        at java.management/java.lang.management.MemoryUsage.<init>(MemoryUsage.java:162)
        at java.management/sun.management.MemoryImpl.getMemoryUsage0(Native Method)
        at java.management/sun.management.MemoryImpl.getHeapMemoryUsage(MemoryImpl.java:72)
        at nsk.monitoring.stress.lowmem.lowmem001$HeapStresser.run(lowmem001.java:162)
        at nsk.share.runner.ThreadsRunner$ManagedThread.run(ThreadsRunner.java:128)
        at java.base/java.lang.Thread.run(Thread.java:1591)
        ----------System.err:(14/771)----------
        nsk.share.TestFailure: Test exit code: 97
        at nsk.share.test.Tests$TestRunner.execute(Tests.java:90)
        at nsk.share.test.Tests$TestRunner.run(Tests.java:96)
        at nsk.share.gc.GC.runTest(GC.java:114)
        at nsk.monitoring.stress.lowmem.lowmem001.main(lowmem001.java:56)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:578)
        at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:125)
        at java.base/java.lang.Thread.run(Thread.java:1591)

        JavaTest Message: Test threw exception: nsk.share.TestFailure: Test exit code: 97
        JavaTest Message: shutting down test

        STATUS:Failed.`main' threw exception: nsk.share.TestFailure: Test exit code: 97

        Attachments

          Issue Links

            Activity

              People

                sjohanss Stefan Johansson
                lmesnik Leonid Mesnik
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: