8130308: Too low memory usage in TestPromotionFromSurvivorToTenuredAfterMinorGC.java

Reviewed-by: dfazunen, brutisso
This commit is contained in:
Jesper Wilhelmsson 2015-08-18 17:32:10 +02:00
parent 0edc019938
commit b2a4dbc30a

View File

@ -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 @@ public class TestPromotionFromSurvivorToTenuredAfterMinorGC {
.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);
}
}