Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit b549cbd

Browse files
author
Thomas Schatzl
committedJan 8, 2021
8258481: gc.g1.plab.TestPLABPromotion fails on Linux x86
Reviewed-by: sjohanss, kbarrett
1 parent fc1d2a1 commit b549cbd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class TestPLABPromotion {
7272
private static final int PLAB_SIZE_HIGH = 65536;
7373
private static final int OBJECT_SIZE_SMALL = 10;
7474
private static final int OBJECT_SIZE_MEDIUM = 100;
75-
private static final int OBJECT_SIZE_HIGH = 3500;
75+
private static final int OBJECT_SIZE_HIGH = 3250;
7676
private static final int GC_NUM_SMALL = 1;
7777
private static final int GC_NUM_MEDIUM = 3;
7878
private static final int GC_NUM_HIGH = 7;
@@ -222,7 +222,7 @@ private static void checkFields(PlabInfo info) {
222222
* @return true if checkedValue is less than MEM_DIFFERENCE_PCT percent of controlValue
223223
*/
224224
private static boolean checkRatio(long checkedValue, long controlValue) {
225-
return (Math.abs(checkedValue) / controlValue) * 100L < MEM_DIFFERENCE_PCT;
225+
return Math.abs(checkedValue * 100.0 / controlValue) < MEM_DIFFERENCE_PCT;
226226
}
227227

228228
/**
@@ -235,7 +235,7 @@ private static boolean checkRatio(long checkedValue, long controlValue) {
235235
* MEM_DIFFERENCE_PCT percent of controlValue
236236
*/
237237
private static boolean checkDifferenceRatio(long checkedValue, long controlValue) {
238-
return (Math.abs(checkedValue - controlValue) / controlValue) * 100L < MEM_DIFFERENCE_PCT;
238+
return Math.abs((checkedValue - controlValue) * 100.0 / controlValue) < MEM_DIFFERENCE_PCT;
239239
}
240240

241241
/**
@@ -304,6 +304,7 @@ public TestCase(int wastePct,
304304
public List<String> toOptions() {
305305
return Arrays.asList("-XX:ParallelGCThreads=" + parGCThreads,
306306
"-XX:ParallelGCBufferWastePct=" + wastePct,
307+
"-XX:ParallelGCThreads=1", // Avoid dynamic sizing of threads.
307308
"-XX:OldPLABSize=" + plabSize,
308309
"-XX:YoungPLABSize=" + plabSize,
309310
"-XX:" + (plabIsFixed ? "-" : "+") + "ResizePLAB",

0 commit comments

Comments
 (0)
This repository has been archived.