equal
deleted
inserted
replaced
28 * @summary Sanity check that the ArrayAllocatorMallocLimit flag can be set. |
28 * @summary Sanity check that the ArrayAllocatorMallocLimit flag can be set. |
29 * The test helps verifying that size_t flags can be set/read. |
29 * The test helps verifying that size_t flags can be set/read. |
30 * @bug 8054823 |
30 * @bug 8054823 |
31 * @key gc |
31 * @key gc |
32 * @library /test/lib |
32 * @library /test/lib |
|
33 * @library / |
33 * @modules java.base/jdk.internal.misc |
34 * @modules java.base/jdk.internal.misc |
34 * java.management |
35 * java.management |
35 * @run driver gc.arguments.TestArrayAllocatorMallocLimit |
36 * @run driver gc.arguments.TestArrayAllocatorMallocLimit |
36 */ |
37 */ |
37 |
38 |
50 |
51 |
51 // size_t ArrayAllocatorMallocLimit = 18446744073709551615{experimental} |
52 // size_t ArrayAllocatorMallocLimit = 18446744073709551615{experimental} |
52 private static final String printFlagsFinalPattern = " *size_t *" + flagName + " *:?= *(\\d+) *\\{experimental\\} *"; |
53 private static final String printFlagsFinalPattern = " *size_t *" + flagName + " *:?= *(\\d+) *\\{experimental\\} *"; |
53 |
54 |
54 public static void testDefaultValue() throws Exception { |
55 public static void testDefaultValue() throws Exception { |
55 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( |
56 ProcessBuilder pb = GCArguments.createJavaProcessBuilder( |
56 "-XX:+UnlockExperimentalVMOptions", "-XX:+PrintFlagsFinal", "-version"); |
57 "-XX:+UnlockExperimentalVMOptions", "-XX:+PrintFlagsFinal", "-version"); |
57 |
58 |
58 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
59 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
59 String value = output.firstMatch(printFlagsFinalPattern, 1); |
60 String value = output.firstMatch(printFlagsFinalPattern, 1); |
60 |
61 |
76 } |
77 } |
77 |
78 |
78 public static void testSetValue() throws Exception { |
79 public static void testSetValue() throws Exception { |
79 long flagValue = 2048; |
80 long flagValue = 2048; |
80 |
81 |
81 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( |
82 ProcessBuilder pb = GCArguments.createJavaProcessBuilder( |
82 "-XX:+UnlockExperimentalVMOptions", "-XX:" + flagName + "=" + flagValue, "-XX:+PrintFlagsFinal", "-version"); |
83 "-XX:+UnlockExperimentalVMOptions", "-XX:" + flagName + "=" + flagValue, "-XX:+PrintFlagsFinal", "-version"); |
83 |
84 |
84 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
85 OutputAnalyzer output = new OutputAnalyzer(pb.start()); |
85 String value = output.firstMatch(printFlagsFinalPattern, 1); |
86 String value = output.firstMatch(printFlagsFinalPattern, 1); |
86 |
87 |