|
24 | 24 | package gc.stress;
|
25 | 25 |
|
26 | 26 | /*
|
27 |
| - * @test TestStressG1Humongous |
| 27 | + * @test |
28 | 28 | * @key stress
|
29 | 29 | * @summary Stress G1 by humongous allocations in situation near OOM
|
30 | 30 | * @requires vm.gc.G1
|
31 | 31 | * @requires !vm.flightRecorder
|
32 | 32 | * @library /test/lib
|
33 | 33 | * @modules java.base/jdk.internal.misc
|
34 |
| - * @run driver/timeout=1300 gc.stress.TestStressG1Humongous |
| 34 | + * @run driver/timeout=180 gc.stress.TestStressG1Humongous 4 3 1.1 120 |
| 35 | + */ |
| 36 | + |
| 37 | +/* |
| 38 | + * @test |
| 39 | + * @requires vm.gc.G1 |
| 40 | + * @requires !vm.flightRecorder |
| 41 | + * @library /test/lib |
| 42 | + * @modules java.base/jdk.internal.misc |
| 43 | + * @run driver/timeout=180 gc.stress.TestStressG1Humongous 16 5 2.1 120 |
| 44 | + */ |
| 45 | + |
| 46 | +/* |
| 47 | + * @test |
| 48 | + * @requires vm.gc.G1 |
| 49 | + * @requires !vm.flightRecorder |
| 50 | + * @library /test/lib |
| 51 | + * @modules java.base/jdk.internal.misc |
| 52 | + * @run driver/timeout=180 gc.stress.TestStressG1Humongous 32 4 0.6 120 |
| 53 | + */ |
| 54 | + |
| 55 | +/* |
| 56 | + * @test |
| 57 | + * @requires vm.gc.G1 |
| 58 | + * @requires !vm.flightRecorder |
| 59 | + * @library /test/lib |
| 60 | + * @modules java.base/jdk.internal.misc |
| 61 | + * @run driver/timeout=900 gc.stress.TestStressG1Humongous 1 7 0.6 600 |
35 | 62 | */
|
36 | 63 |
|
37 | 64 | import java.util.ArrayList;
|
|
48 | 75 | public class TestStressG1Humongous{
|
49 | 76 |
|
50 | 77 | public static void main(String[] args) throws Exception {
|
| 78 | + if (args.length != 4) { |
| 79 | + throw new IllegalArgumentException("Test expects 4 arguments"); |
| 80 | + } |
| 81 | + |
51 | 82 | // Limit heap size on 32-bit platforms
|
52 | 83 | int heapSize = Platform.is32bit() ? 512 : 1024;
|
53 |
| - // Heap size, region size, threads, humongous size, timeout |
54 |
| - run(heapSize, 4, 3, 1.1, 120); |
55 |
| - run(heapSize, 16, 5, 2.1, 120); |
56 |
| - run(heapSize, 32, 4, 0.6, 120); |
57 |
| - run(heapSize, 1, 7, 0.6, 600); |
58 |
| - } |
59 | 84 |
|
60 |
| - private static void run(int heapSize, int regionSize, int threads, double humongousSize, int timeout) |
61 |
| - throws Exception { |
| 85 | + // Region size, threads, humongous size, and timeout passed as @run arguments |
| 86 | + int regionSize = Integer.parseInt(args[0]); |
| 87 | + int threads = Integer.parseInt(args[1]); |
| 88 | + double humongousSize = Double.parseDouble(args[2]); |
| 89 | + int timeout = Integer.parseInt(args[3]); |
| 90 | + |
62 | 91 | ArrayList<String> options = new ArrayList<>();
|
63 | 92 | Collections.addAll(options, Utils.getTestJavaOpts());
|
64 | 93 | Collections.addAll(options,
|
|
0 commit comments