8252196: ZGC: TestUncommit.java fails due to "Exception: Uncommitted too fast" again(2)

Reviewed-by: stefank, eosterlund
This commit is contained in:
Per Lidén 2020-09-17 10:05:43 +00:00
parent a9993f9464
commit f972155d63

View file

@ -68,12 +68,12 @@ public class TestUncommit {
private static void test(int objectSize) throws Exception { private static void test(int objectSize) throws Exception {
final var beforeAlloc = capacity(); final var beforeAlloc = capacity();
final var timeBeforeAlloc = System.nanoTime();
// Allocate memory // Allocate memory
log("Allocating"); log("Allocating");
allocate(objectSize); allocate(objectSize);
final var timeAfterAlloc = System.nanoTime();
final var afterAlloc = capacity(); final var afterAlloc = capacity();
// Reclaim memory // Reclaim memory
@ -87,7 +87,7 @@ public class TestUncommit {
log("Uncommit started"); log("Uncommit started");
final var timeUncommitStart = System.nanoTime(); final var timeUncommitStart = System.nanoTime();
final var actualDelay = (timeUncommitStart - timeAfterAlloc) / 1_000_000; final var actualDelay = (timeUncommitStart - timeBeforeAlloc) / 1_000_000;
log("Waiting for uncommit to complete"); log("Waiting for uncommit to complete");
while (capacity() > beforeAlloc) { while (capacity() > beforeAlloc) {