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=iu-aggressive
104  * @key stress
105  * @library /
106  * @requires vm.gc.Shenandoah
107  * @requires vm.flavor == "server" & !vm.emulatedClient
108  * @summary Stress the Shenandoah GC by trying to make old objects more likely to be garbage than young objects.
109  *
110  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
111  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
112  *      -XX:+ShenandoahOOMDuringEvacALot
113  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
114  *
115  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
116  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
117  *      -XX:+ShenandoahAllocFailureALot
118  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
119  *
120  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
121  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
122  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
123  */
124 
125 /*
126  * @test id=iu
127  * @key stress
128  * @library /
129  * @requires vm.gc.Shenandoah
130  * @requires vm.flavor == "server" & !vm.emulatedClient
131  * @summary Stress the Shenandoah GC by trying to make old objects more likely to be garbage than young objects.
132  *
133  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
134  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
135  *      -XX:+ShenandoahVerify
136  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
137  *
138  * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
139  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
140  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
141  */
142 
143 /*
144  * @test id=passive-deopt-nmethod
145  * @key stress
146  * @library /
147  * @requires vm.gc.Shenandoah
148  * @requires vm.flavor == "server" & !vm.emulatedClient & vm.opt.ClassUnloading != false
149  * @summary Stress Shenandoah GC with nmethod barrier forced deoptimization enabled.
150  *
151  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
152  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
153  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
154  *      -XX:+ShenandoahVerify -XX:+ShenandoahDegeneratedGC
155  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
156  *
157  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
158  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
159  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
160  *      -XX:+ShenandoahVerify -XX:-ShenandoahDegeneratedGC
161  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
162  */
163 
164 /*
165  * @test id=aggressive-deopt-nmethod
166  * @key stress
167  * @library /
168  * @requires vm.gc.Shenandoah
169  * @requires vm.flavor == "server" & !vm.emulatedClient & vm.opt.ClassUnloading != false
170  * @summary Stress Shenandoah GC with nmethod barrier forced deoptimization enabled.
171  *
172  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
173  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
174  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
175  *      -XX:+ShenandoahOOMDuringEvacALot
176  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
177  *
178  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
179  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
180  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
181  *      -XX:+ShenandoahAllocFailureALot
182  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
183  *
184  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
185  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
186  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
187  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
188  */
189 
190 /*
191  * @test id=adaptive-deopt-nmethod
192  * @key stress
193  * @library /
194  * @requires vm.gc.Shenandoah
195  * @requires vm.flavor == "server" & !vm.emulatedClient & vm.opt.ClassUnloading != false
196  * @summary Stress Shenandoah GC with nmethod barrier forced deoptimization enabled.
197  *
198  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
199  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
200  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
201  *      -XX:+ShenandoahVerify
202  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
203  *
204  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
205  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
206  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
207  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
208  */
209 
210 /*
211  * @test id=compact-deopt-nmethod
212  * @key stress
213  * @library /
214  * @requires vm.gc.Shenandoah
215  * @requires vm.flavor == "server" & !vm.emulatedClient & vm.opt.ClassUnloading != false
216  * @summary Stress Shenandoah GC with nmethod barrier forced deoptimization enabled.
217  *
218  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
219  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
220  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
221  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
222  */
223 
224 /*
225  * @test id=iu-aggressive-deopt-nmethod
226  * @key stress
227  * @library /
228  * @requires vm.gc.Shenandoah
229  * @requires vm.flavor == "server" & !vm.emulatedClient & vm.opt.ClassUnloading != false
230  * @summary Stress Shenandoah GC with nmethod barrier forced deoptimization enabled.
231  *
232  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
233  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
234  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
235  *      -XX:+ShenandoahOOMDuringEvacALot
236  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
237  *
238  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
239  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
240  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
241  *      -XX:+ShenandoahAllocFailureALot
242  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
243  *
244  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
245  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
246  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
247  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
248  */
249 
250 /*
251  * @test id=iu-deopt-nmethod
252  * @key stress
253  * @library /
254  * @requires vm.gc.Shenandoah
255  * @requires vm.flavor == "server" & !vm.emulatedClient & vm.opt.ClassUnloading != false
256  * @summary Stress Shenandoah GC with nmethod barrier forced deoptimization enabled.
257  *
258  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
259  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
260  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
261  *      -XX:+ShenandoahVerify
262  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
263  *
264  * @run main/othervm/timeout=200 -Xlog:gc*=info,nmethod+barrier=trace -Xmx1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
265  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
266  *      -XX:+DeoptimizeNMethodBarriersALot -XX:-Inline
267  *      gc.stress.gcbasher.TestGCBasherWithShenandoah 120000
268  */
269 
270 
271 public class TestGCBasherWithShenandoah {
272     public static void main(String[] args) throws IOException {
273         TestGCBasher.main(args);
274     }
275 }