Skip to content

Commit f972155

Browse files
committed
8252196: ZGC: TestUncommit.java fails due to "Exception: Uncommitted too fast" again(2)
Reviewed-by: stefank, eosterlund
1 parent a9993f9 commit f972155

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/hotspot/jtreg/gc/z/TestUncommit.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ private static void reclaim() {
6868

6969
private static void test(int objectSize) throws Exception {
7070
final var beforeAlloc = capacity();
71+
final var timeBeforeAlloc = System.nanoTime();
7172

7273
// Allocate memory
7374
log("Allocating");
7475
allocate(objectSize);
7576

76-
final var timeAfterAlloc = System.nanoTime();
7777
final var afterAlloc = capacity();
7878

7979
// Reclaim memory
@@ -87,7 +87,7 @@ private static void test(int objectSize) throws Exception {
8787

8888
log("Uncommit started");
8989
final var timeUncommitStart = System.nanoTime();
90-
final var actualDelay = (timeUncommitStart - timeAfterAlloc) / 1_000_000;
90+
final var actualDelay = (timeUncommitStart - timeBeforeAlloc) / 1_000_000;
9191

9292
log("Waiting for uncommit to complete");
9393
while (capacity() > beforeAlloc) {

0 commit comments

Comments
 (0)