35 import java.util.Arrays;
36 import java.util.Collections;
37 import java.util.LinkedList;
38 import java.util.List;
39 import jdk.internal.misc.Unsafe; // for ADDRESS_SIZE
40 import sun.hotspot.WhiteBox;
41
42 public class TestShrinkAuxiliaryData {
43
44 private static final int REGION_SIZE = 1024 * 1024;
45
46 private final static String[] initialOpts = new String[]{
47 "-XX:MinHeapFreeRatio=10",
48 "-XX:MaxHeapFreeRatio=11",
49 "-XX:+UseG1GC",
50 "-XX:G1HeapRegionSize=" + REGION_SIZE,
51 "-XX:-ExplicitGCInvokesConcurrent",
52 "-Xlog:gc=debug",
53 "-XX:+UnlockDiagnosticVMOptions",
54 "-XX:+WhiteBoxAPI",
55 "-XaddExports:java.base/jdk.internal.misc=ALL-UNNAMED",
56 "-Xbootclasspath/a:.",
57 };
58
59 private final int hotCardTableSize;
60
61 protected TestShrinkAuxiliaryData(int hotCardTableSize) {
62 this.hotCardTableSize = hotCardTableSize;
63 }
64
65 protected void test() throws Exception {
66 ArrayList<String> vmOpts = new ArrayList();
67 Collections.addAll(vmOpts, initialOpts);
68
69 int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
70 if (maxCacheSize < hotCardTableSize) {
71 System.out.format("Skiping test for %d cache size due max cache size %d",
72 hotCardTableSize, maxCacheSize
73 );
74 return;
75 }
|
35 import java.util.Arrays;
36 import java.util.Collections;
37 import java.util.LinkedList;
38 import java.util.List;
39 import jdk.internal.misc.Unsafe; // for ADDRESS_SIZE
40 import sun.hotspot.WhiteBox;
41
42 public class TestShrinkAuxiliaryData {
43
44 private static final int REGION_SIZE = 1024 * 1024;
45
46 private final static String[] initialOpts = new String[]{
47 "-XX:MinHeapFreeRatio=10",
48 "-XX:MaxHeapFreeRatio=11",
49 "-XX:+UseG1GC",
50 "-XX:G1HeapRegionSize=" + REGION_SIZE,
51 "-XX:-ExplicitGCInvokesConcurrent",
52 "-Xlog:gc=debug",
53 "-XX:+UnlockDiagnosticVMOptions",
54 "-XX:+WhiteBoxAPI",
55 "--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
56 "-Xbootclasspath/a:.",
57 };
58
59 private final int hotCardTableSize;
60
61 protected TestShrinkAuxiliaryData(int hotCardTableSize) {
62 this.hotCardTableSize = hotCardTableSize;
63 }
64
65 protected void test() throws Exception {
66 ArrayList<String> vmOpts = new ArrayList();
67 Collections.addAll(vmOpts, initialOpts);
68
69 int maxCacheSize = Math.max(0, Math.min(31, getMaxCacheSize()));
70 if (maxCacheSize < hotCardTableSize) {
71 System.out.format("Skiping test for %d cache size due max cache size %d",
72 hotCardTableSize, maxCacheSize
73 );
74 return;
75 }
|