Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/gc/shenandoah/TestLotsOfCycles.java
32284 views
/*1* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation.6*7* This code is distributed in the hope that it will be useful, but WITHOUT8* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License10* version 2 for more details (a copy is included in the LICENSE file that11* accompanied this code).12*13* You should have received a copy of the GNU General Public License version14* 2 along with this work; if not, write to the Free Software Foundation,15* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.16*17* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA18* or visit www.oracle.com if you need additional information or have any19* questions.20*21*/2223/*24* @test TestLotsOfCycles25* @key gc26*27* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions28* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive29* -XX:+ShenandoahDegeneratedGC30* -Dtarget=1000031* TestLotsOfCycles32*33* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions34* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive35* -XX:-ShenandoahDegeneratedGC36* -Dtarget=1000037* TestLotsOfCycles38*/3940/*41* @test TestLotsOfCycles42* @key gc43*44* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions45* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive46* -XX:+ShenandoahOOMDuringEvacALot47* -Dtarget=100048* TestLotsOfCycles49*50* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions51* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive52* -XX:+ShenandoahAllocFailureALot53* -Dtarget=100054* TestLotsOfCycles55*56* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions57* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive58* -Dtarget=100059* TestLotsOfCycles60*/6162/*63* @test TestLotsOfCycles64* @key gc65*66* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions67* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive68* -Dtarget=1000069* TestLotsOfCycles70*/7172/*73* @test TestLotsOfCycles74* @key gc75*76* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions77* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static78* -Dtarget=1000079* TestLotsOfCycles80*/8182/*83* @test TestLotsOfCycles84* @key gc85*86* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions87* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact88* -Dtarget=100089* TestLotsOfCycles90*/9192/*93* @test TestLotsOfCycles94* @key gc95*96* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions97* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive98* -XX:+ShenandoahOOMDuringEvacALot99* -Dtarget=1000100* TestLotsOfCycles101*102* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions103* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive104* -XX:+ShenandoahAllocFailureALot105* -Dtarget=1000106* TestLotsOfCycles107*108* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions109* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive110* -Dtarget=1000111* TestLotsOfCycles112*/113114/*115* @test TestLotsOfCycles116* @key gc117*118* @run main/othervm/timeout=480 -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions119* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu120* -Dtarget=10000121* TestLotsOfCycles122*/123124public class TestLotsOfCycles {125126static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation, around 1K cycles to handle127static final long STRIDE = 100_000;128129static volatile Object sink;130131public static void main(String[] args) throws Exception {132long count = TARGET_MB * 1024 * 1024 / 16;133for (long c = 0; c < count; c += STRIDE) {134for (long s = 0; s < STRIDE; s++) {135sink = new Object();136}137Thread.sleep(1);138}139}140141}142143144