< prev index next >

test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java

Print this page

        

*** 26,36 **** * @bug 8031323 * @summary Verify that objects promoted from survivor space to tenured space * when their age exceeded tenuring threshold are not aligned to * SurvivorAlignmentInBytes value. * @library /testlibrary /../../test/lib - * @ignore 8130308 * @modules java.base/sun.misc * java.management * @build TestPromotionFromSurvivorToTenuredAfterMinorGC * SurvivorAlignmentTestMain AlignmentHelper * @run main ClassFileInstaller sun.hotspot.WhiteBox --- 26,35 ----
*** 97,109 **** expectedMemoryUsage += SurvivorAlignmentTestMain.getAlignmentHelper( SurvivorAlignmentTestMain.HeapSpace.TENURED) .getActualMemoryUsage(); test.allocate(); ! for (int i = 0; i <= SurvivorAlignmentTestMain.MAX_TENURING_THRESHOLD; ! i++) { SurvivorAlignmentTestMain.WHITE_BOX.youngGC(); } test.verifyMemoryUsage(expectedMemoryUsage); } } --- 96,115 ---- expectedMemoryUsage += SurvivorAlignmentTestMain.getAlignmentHelper( SurvivorAlignmentTestMain.HeapSpace.TENURED) .getActualMemoryUsage(); test.allocate(); ! for (int i = 0; i <= SurvivorAlignmentTestMain.MAX_TENURING_THRESHOLD; i++) { SurvivorAlignmentTestMain.WHITE_BOX.youngGC(); } + // Sometimes we see that data unrelated to the test has been allocated during + // the loop. This data is included in the expectedMemoryUsage since we look + // through all threads to see what they allocated. If this data is still in + // the survivor area however, it should not be included in expectedMemoryUsage + // since the verification below only look at what's in tenured space. + expectedMemoryUsage -= SurvivorAlignmentTestMain.getAlignmentHelper( + SurvivorAlignmentTestMain.HeapSpace.SURVIVOR) + .getActualMemoryUsage(); test.verifyMemoryUsage(expectedMemoryUsage); } }
< prev index next >