Path: blob/master/test/hotspot/jtreg/gc/shenandoah/TestLotsOfCycles.java
40942 views
/*1* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324/*25* @test TestLotsOfCycles26* @requires vm.gc.Shenandoah27*28* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions29* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive30* -XX:+ShenandoahDegeneratedGC31* -Dtarget=1000032* TestLotsOfCycles33*34* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions35* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive36* -XX:-ShenandoahDegeneratedGC37* -Dtarget=1000038* TestLotsOfCycles39*/4041/*42* @test TestLotsOfCycles43* @requires vm.gc.Shenandoah44*45* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions46* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive47* -XX:+ShenandoahOOMDuringEvacALot48* -Dtarget=100049* TestLotsOfCycles50*51* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions52* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive53* -XX:+ShenandoahAllocFailureALot54* -Dtarget=100055* TestLotsOfCycles56*57* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions58* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive59* -Dtarget=100060* TestLotsOfCycles61*/6263/*64* @test TestLotsOfCycles65* @requires vm.gc.Shenandoah66*67* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions68* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive69* -Dtarget=1000070* TestLotsOfCycles71*/7273/*74* @test TestLotsOfCycles75* @requires vm.gc.Shenandoah76*77* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions78* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static79* -Dtarget=1000080* TestLotsOfCycles81*/8283/*84* @test TestLotsOfCycles85* @requires vm.gc.Shenandoah86*87* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions88* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact89* -Dtarget=100090* TestLotsOfCycles91*/9293/*94* @test TestLotsOfCycles95* @requires vm.gc.Shenandoah96*97* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions98* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive99* -XX:+ShenandoahOOMDuringEvacALot100* -Dtarget=1000101* TestLotsOfCycles102*103* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions104* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive105* -XX:+ShenandoahAllocFailureALot106* -Dtarget=1000107* TestLotsOfCycles108*109* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions110* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive111* -Dtarget=1000112* TestLotsOfCycles113*/114115/*116* @test TestLotsOfCycles117* @requires vm.gc.Shenandoah118*119* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions120* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu121* -Dtarget=10000122* TestLotsOfCycles123*/124125public class TestLotsOfCycles {126127static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation, around 1K cycles to handle128static final long STRIDE = 100_000;129130static volatile Object sink;131132public static void main(String[] args) throws Exception {133long count = TARGET_MB * 1024 * 1024 / 16;134for (long c = 0; c < count; c += STRIDE) {135for (long s = 0; s < STRIDE; s++) {136sink = new Object();137}138Thread.sleep(1);139}140}141142}143144145