Skip to content

Commit

Permalink
Automatic merge of jdk:master into master
Browse files Browse the repository at this point in the history
  • Loading branch information
duke committed Jan 8, 2021
2 parents 89ca2b0 + b549cbd commit 11fb61f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java
Expand Up @@ -72,7 +72,7 @@ public class TestPLABPromotion {
private static final int PLAB_SIZE_HIGH = 65536;
private static final int OBJECT_SIZE_SMALL = 10;
private static final int OBJECT_SIZE_MEDIUM = 100;
private static final int OBJECT_SIZE_HIGH = 3500;
private static final int OBJECT_SIZE_HIGH = 3250;
private static final int GC_NUM_SMALL = 1;
private static final int GC_NUM_MEDIUM = 3;
private static final int GC_NUM_HIGH = 7;
Expand Down Expand Up @@ -222,7 +222,7 @@ private static void checkFields(PlabInfo info) {
* @return true if checkedValue is less than MEM_DIFFERENCE_PCT percent of controlValue
*/
private static boolean checkRatio(long checkedValue, long controlValue) {
return (Math.abs(checkedValue) / controlValue) * 100L < MEM_DIFFERENCE_PCT;
return Math.abs(checkedValue * 100.0 / controlValue) < MEM_DIFFERENCE_PCT;
}

/**
Expand All @@ -235,7 +235,7 @@ private static boolean checkRatio(long checkedValue, long controlValue) {
* MEM_DIFFERENCE_PCT percent of controlValue
*/
private static boolean checkDifferenceRatio(long checkedValue, long controlValue) {
return (Math.abs(checkedValue - controlValue) / controlValue) * 100L < MEM_DIFFERENCE_PCT;
return Math.abs((checkedValue - controlValue) * 100.0 / controlValue) < MEM_DIFFERENCE_PCT;
}

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

0 comments on commit 11fb61f

Please sign in to comment.