Mercurial > hg > jdk9-shenandoah > hotspot
changeset 9647:1facc49c0499
8130308: Too low memory usage in TestPromotionFromSurvivorToTenuredAfterMinorGC.java
Reviewed-by: dfazunen, brutisso
author | jwilhelm |
---|---|
date | Tue, 18 Aug 2015 17:32:10 +0200 |
parents | 7100bb7e213f |
children | e9d225520e8c |
files | test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java |
diffstat | 1 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java Mon Aug 17 13:55:02 2015 +0200 +++ b/test/gc/survivorAlignment/TestPromotionFromSurvivorToTenuredAfterMinorGC.java Tue Aug 18 17:32:10 2015 +0200 @@ -28,7 +28,6 @@ * 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 @@ -99,11 +98,18 @@ .getActualMemoryUsage(); test.allocate(); - for (int i = 0; i <= SurvivorAlignmentTestMain.MAX_TENURING_THRESHOLD; - i++) { + 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); } }