Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/gc/shenandoah/TestGCThreadGroups.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 TestGCThreadGroups25* @summary Test Shenandoah GC uses concurrent/parallel threads correctly26* @key gc27*28* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions29* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive30* -XX:ConcGCThreads=2 -XX:ParallelGCThreads=431* -Dtarget=100032* TestGCThreadGroups33*/3435/**36* @test TestGCThreadGroups37* @summary Test Shenandoah GC uses concurrent/parallel threads correctly38* @key gc39*40* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions41* -XX:+UseShenandoahGC42* -XX:ConcGCThreads=2 -XX:ParallelGCThreads=443* -Dtarget=100044* TestGCThreadGroups45*46* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions47* -XX:+UseShenandoahGC48* -XX:-UseDynamicNumberOfGCThreads49* -Dtarget=100050* TestGCThreadGroups51*52* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions53* -XX:+UseShenandoahGC54* -XX:+ForceDynamicNumberOfGCThreads55* -Dtarget=100056* TestGCThreadGroups57*58* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions59* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive60* -XX:ConcGCThreads=2 -XX:ParallelGCThreads=461* -Dtarget=100062* TestGCThreadGroups63*64* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions65* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static66* -XX:ConcGCThreads=2 -XX:ParallelGCThreads=467* -Dtarget=100068* TestGCThreadGroups69*70* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions71* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact72* -XX:ConcGCThreads=2 -XX:ParallelGCThreads=473* -Dtarget=10074* TestGCThreadGroups75*76* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions77* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive78* -XX:ConcGCThreads=2 -XX:ParallelGCThreads=479* -Dtarget=10080* TestGCThreadGroups81*/8283/**84* @test TestGCThreadGroups85* @summary Test Shenandoah GC uses concurrent/parallel threads correctly86* @key gc87*88* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions89* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu90* -XX:ConcGCThreads=2 -XX:ParallelGCThreads=491* -Dtarget=100092* TestGCThreadGroups93*94* @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions95* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive96* -XX:ConcGCThreads=2 -XX:ParallelGCThreads=497* -Dtarget=100098* TestGCThreadGroups99*/100101public class TestGCThreadGroups {102103static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation, around 1K cycles to handle104static final long STRIDE = 100_000;105106static volatile Object sink;107108public static void main(String[] args) throws Exception {109long count = TARGET_MB * 1024 * 1024 / 16;110for (long c = 0; c < count; c += STRIDE) {111for (long s = 0; s < STRIDE; s++) {112sink = new Object();113}114Thread.sleep(1);115}116}117118}119120121