test/hotspot/jtreg/gc/arguments/TestInitialTenuringThreshold.java
changeset 55610 47fdb5b0fa41
parent 53523 4c5184c56dc2
equal deleted inserted replaced
55609:377e49b3014c 55610:47fdb5b0fa41
    28  * @key gc
    28  * @key gc
    29  * @bug 8014765
    29  * @bug 8014765
    30  * @requires vm.gc.Parallel
    30  * @requires vm.gc.Parallel
    31  * @summary Tests argument processing for initial tenuring threshold
    31  * @summary Tests argument processing for initial tenuring threshold
    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 main/othervm gc.arguments.TestInitialTenuringThreshold
    36  * @run main/othervm gc.arguments.TestInitialTenuringThreshold
    36  * @author thomas.schatzl@oracle.com
    37  * @author thomas.schatzl@oracle.com
    37  */
    38  */
    40 import jdk.test.lib.process.ProcessTools;
    41 import jdk.test.lib.process.ProcessTools;
    41 
    42 
    42 public class TestInitialTenuringThreshold {
    43 public class TestInitialTenuringThreshold {
    43 
    44 
    44   public static void runWithThresholds(int initial, int max, boolean shouldfail) throws Exception {
    45   public static void runWithThresholds(int initial, int max, boolean shouldfail) throws Exception {
    45     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
    46     ProcessBuilder pb = GCArguments.createJavaProcessBuilder(
    46       "-XX:+UseParallelGC",
    47       "-XX:+UseParallelGC",
    47       "-XX:InitialTenuringThreshold=" + String.valueOf(initial),
    48       "-XX:InitialTenuringThreshold=" + String.valueOf(initial),
    48       "-XX:MaxTenuringThreshold=" + String.valueOf(max),
    49       "-XX:MaxTenuringThreshold=" + String.valueOf(max),
    49       "-version"
    50       "-version"
    50       );
    51       );
    57     }
    58     }
    58   }
    59   }
    59 
    60 
    60 
    61 
    61   public static void main(String args[]) throws Exception {
    62   public static void main(String args[]) throws Exception {
    62     ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
    63     ProcessBuilder pb = GCArguments.createJavaProcessBuilder(
    63       // some value below the default value of InitialTenuringThreshold of 7
    64       // some value below the default value of InitialTenuringThreshold of 7
    64       "-XX:MaxTenuringThreshold=1",
    65       "-XX:MaxTenuringThreshold=1",
    65       "-version"
    66       "-version"
    66       );
    67       );
    67 
    68