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

G1 applies SurvivorAlignmentInBytes to both survivor and old gen

XMLWordPrintable

    • gc
    • b72

        The test test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java on Solaris x64 and Windows x64 fails with 8u60b09 and 9.

        The problem is that since JDK-8060025 the survivor alignment is used independently of target generation.

        Tests to reproduce:

        1. Take 8u60b09 or above
        2. run jtreg -nr -va -vmoptions:' -XX:+UseG1GC ' hotspot/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java
        3. Observe error: Actual memory usage should not deviate from expected for more then 682456

        E.g.
        For 8u60b08 we could see:
        Verifying memory usage in space: TENURED
        Allocated objects count: 655360
        Desired object size: 16
        Actual object size: 16
        Expected object size in space: 16
        Expected memory usage: 13648120
        Actual memory usage: 13735160
        Memory usage diff: 87040
        Max allowed usage diff: 682408

        for 8u60b09 (and above):
        Verifying memory usage in space: TENURED
        Allocated objects count: 655360
        Desired object size: 16
        Actual object size: 16
        Expected object size in space: 16
        Expected memory usage: 13648984
        Actual memory usage: 24141400
        Memory usage diff: 10492416
        Max allowed usage diff: 682456
        STDERR:
        java.lang.RuntimeException: Actual memory usage should not deviate from expected for more then 682456
                at com.oracle.java.testlibrary.Asserts.error(Asserts.java:450)
                at com.oracle.java.testlibrary.Asserts.assertTrue(Asserts.java:377)
                at com.oracle.java.testlibrary.Asserts.assertLessThanOrEqual(Asserts.java:124)
                at com.oracle.java.testlibrary.Asserts.assertLTE(Asserts.java:102)
                at SurvivorAlignmentTestMain.verifyMemoryUsage(SurvivorAlignmentTestMain.java:333)
                at TestPromotionFromSurvivorToTenuredAfterMinorGC.main(TestPromotionFromSurvivorToTenuredAfterMinorGC.java:104)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.lang.reflect.Method.invoke(Method.java:497)
                at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92)
                at java.lang.Thread.run(Thread.java:745)

        alternatively, in jdk9 the test passes with a "Memory usage diff is incorrect, but it seems like someone else allocated objects" which is a false positive.

        Regression: yes
        Stable: yes

              tschatzl Thomas Schatzl
              tschatzl Thomas Schatzl
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: