diff --git a/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java b/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java index f1e23d43c0729cbe7af5ad50e15fc72a6eb84bad..983b9f6c33fecdff46a8fd1f1d06fd4519bfc25b 100644 --- a/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java +++ b/test/hotspot/jtreg/gc/stress/TestStressG1Humongous.java @@ -24,14 +24,41 @@ package gc.stress; /* - * @test TestStressG1Humongous + * @test * @key stress * @summary Stress G1 by humongous allocations in situation near OOM * @requires vm.gc.G1 * @requires !vm.flightRecorder * @library /test/lib * @modules java.base/jdk.internal.misc - * @run driver/timeout=1300 gc.stress.TestStressG1Humongous + * @run driver/timeout=180 gc.stress.TestStressG1Humongous 4 3 1.1 120 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires !vm.flightRecorder + * @library /test/lib + * @modules java.base/jdk.internal.misc + * @run driver/timeout=180 gc.stress.TestStressG1Humongous 16 5 2.1 120 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires !vm.flightRecorder + * @library /test/lib + * @modules java.base/jdk.internal.misc + * @run driver/timeout=180 gc.stress.TestStressG1Humongous 32 4 0.6 120 + */ + +/* + * @test + * @requires vm.gc.G1 + * @requires !vm.flightRecorder + * @library /test/lib + * @modules java.base/jdk.internal.misc + * @run driver/timeout=900 gc.stress.TestStressG1Humongous 1 7 0.6 600 */ import java.util.ArrayList; @@ -48,17 +75,19 @@ import jdk.test.lib.process.OutputAnalyzer; public class TestStressG1Humongous{ public static void main(String[] args) throws Exception { + if (args.length != 4) { + throw new IllegalArgumentException("Test expects 4 arguments"); + } + // Limit heap size on 32-bit platforms int heapSize = Platform.is32bit() ? 512 : 1024; - // Heap size, region size, threads, humongous size, timeout - run(heapSize, 4, 3, 1.1, 120); - run(heapSize, 16, 5, 2.1, 120); - run(heapSize, 32, 4, 0.6, 120); - run(heapSize, 1, 7, 0.6, 600); - } - private static void run(int heapSize, int regionSize, int threads, double humongousSize, int timeout) - throws Exception { + // Region size, threads, humongous size, and timeout passed as @run arguments + int regionSize = Integer.parseInt(args[0]); + int threads = Integer.parseInt(args[1]); + double humongousSize = Double.parseDouble(args[2]); + int timeout = Integer.parseInt(args[3]); + ArrayList<String> options = new ArrayList<>(); Collections.addAll(options, Utils.getTestJavaOpts()); Collections.addAll(options,