1 /*
  2  * Copyright (c) 2016, 2018, Red Hat, Inc. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 package gc.stress.gcbasher;
 26 
 27 import java.io.IOException;
 28 
 29 /*
 30  * @test id=passive
 31  * @key stress
 32  * @library /
 33  * @requires vm.gc.Shenandoah
 34  * @requires vm.flavor == "server" & !vm.emulatedClient
 35  * @summary Stress the Shenandoah GC by trying to make old objects more likely to be garbage than young objects.
 36  *
 37  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 38  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
 39  *      -XX:+ShenandoahVerify -XX:+ShenandoahDegeneratedGC
 40  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
 41  *
 42  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 43  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
 44  *      -XX:+ShenandoahVerify -XX:-ShenandoahDegeneratedGC
 45  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
 46  */
 47 
 48 /*
 49  * @test id=aggressive
 50  * @key stress
 51  * @library /
 52  * @requires vm.gc.Shenandoah
 53  * @requires vm.flavor == "server" & !vm.emulatedClient
 54  * @summary Stress the Shenandoah GC by trying to make old objects more likely to be garbage than young objects.
 55  *
 56  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 57  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
 58  *      -XX:+ShenandoahOOMDuringEvacALot
 59  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
 60  *
 61  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 62  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
 63  *      -XX:+ShenandoahAllocFailureALot
 64  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
 65  *
 66  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 67  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
 68  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
 69  */
 70 
 71 /*
 72  * @test id=adaptive
 73  * @key stress
 74  * @library /
 75  * @requires vm.gc.Shenandoah
 76  * @requires vm.flavor == "server" & !vm.emulatedClient
 77  * @summary Stress the Shenandoah GC by trying to make old objects more likely to be garbage than young objects.
 78  *
 79  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 80  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
 81  *      -XX:+ShenandoahVerify
 82  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
 83  *
 84  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 85  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
 86  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
 87  */
 88 
 89 /*
 90  * @test id=compact
 91  * @key stress
 92  * @library /
 93  * @requires vm.gc.Shenandoah
 94  * @requires vm.flavor == "server" & !vm.emulatedClient & vm.opt.ClassUnloading != false
 95  * @summary Stress Shenandoah GC with nmethod barrier forced deoptimization enabled.
 96  *
 97  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 98  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
 99  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
100  */
101 
102 /*
103  * @test id=passive-deopt-nmethod
104  * @key stress
105  * @library /
106  * @requires vm.gc.Shenandoah
107  * @requires vm.flavor == "server" & !vm.emulatedClient & vm.opt.ClassUnloading != false
108  * @summary Stress Shenandoah GC with nmethod barrier forced deoptimization enabled.
109  *
110  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
111  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
112  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
113  *      -XX:+ShenandoahVerify -XX:+ShenandoahDegeneratedGC
114  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
115  *
116  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
117  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
118  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
119  *      -XX:+ShenandoahVerify -XX:-ShenandoahDegeneratedGC
120  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
121  */
122 
123 /*
124  * @test id=aggressive-deopt-nmethod
125  * @key stress
126  * @library /
127  * @requires vm.gc.Shenandoah
128  * @requires vm.flavor == "server" & !vm.emulatedClient & vm.opt.ClassUnloading != false
129  * @summary Stress Shenandoah GC with nmethod barrier forced deoptimization enabled.
130  *
131  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
132  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
133  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
134  *      -XX:+ShenandoahOOMDuringEvacALot
135  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
136  *
137  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
138  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
139  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
140  *      -XX:+ShenandoahAllocFailureALot
141  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
142  *
143  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
144  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
145  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
146  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
147  */
148 
149 /*
150  * @test id=adaptive-deopt-nmethod
151  * @key stress
152  * @library /
153  * @requires vm.gc.Shenandoah
154  * @requires vm.flavor == "server" & !vm.emulatedClient & vm.opt.ClassUnloading != false
155  * @summary Stress Shenandoah GC with nmethod barrier forced deoptimization enabled.
156  *
157  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
158  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
159  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
160  *      -XX:+ShenandoahVerify
161  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
162  *
163  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
164  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
165  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
166  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
167  */
168 
169 /*
170  * @test id=compact-deopt-nmethod
171  * @key stress
172  * @library /
173  * @requires vm.gc.Shenandoah
174  * @requires vm.flavor == "server" & !vm.emulatedClient & vm.opt.ClassUnloading != false
175  * @summary Stress Shenandoah GC with nmethod barrier forced deoptimization enabled.
176  *
177  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
178  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
179  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
180  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
181  */
182 
183 public class TestGCBasherWithShenandoah {
184     public static void main(String[] args) throws IOException {
185         TestGCBasher.main(args);
186     }
187 }