Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/gc/shenandoah/TestAllocObjects.java
32284 views
/*1* Copyright (c) 2016, 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 TestAllocObjects25* @summary Acceptance tests: collector can withstand allocation26* @key gc27*28* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions29* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive30* -XX:+ShenandoahDegeneratedGC -XX:+ShenandoahVerify31* TestAllocObjects32*33* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions34* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive35* -XX:-ShenandoahDegeneratedGC -XX:+ShenandoahVerify36* TestAllocObjects37*38* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions39* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive40* -XX:+ShenandoahDegeneratedGC41* TestAllocObjects42*43* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions44* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive45* -XX:-ShenandoahDegeneratedGC46* TestAllocObjects47*/4849/*50* @test TestAllocObjects51* @summary Acceptance tests: collector can withstand allocation52* @key gc53*54* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions55* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive56* -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify57* TestAllocObjects58*59* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions60* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive61* -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify62* TestAllocObjects63*64* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions65* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive66* -XX:+ShenandoahOOMDuringEvacALot67* TestAllocObjects68*69* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions70* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive71* -XX:+ShenandoahAllocFailureALot72* TestAllocObjects73*74* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions75* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive76* TestAllocObjects77*78* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions79* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive80* -XX:+ShenandoahVerify81* TestAllocObjects82*83*/8485/*86* @test TestAllocObjects87* @summary Acceptance tests: collector can withstand allocation88* @key gc89*90* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions91* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive92* TestAllocObjects93*94* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions95* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static96* TestAllocObjects97*/9899/*100* @test TestAllocObjects101* @summary Acceptance tests: collector can withstand allocation102* @key gc103*104* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions105* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact106* TestAllocObjects107*/108109/*110* @test TestAllocObjects111* @summary Acceptance tests: collector can withstand allocation112* @key gc113*114* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions115* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive116* -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify117* TestAllocObjects118*/119120/*121* @test TestAllocObjects122* @summary Acceptance tests: collector can withstand allocation123* @key gc124*125* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions126* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive127* -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify128* TestAllocObjects129*130* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions131* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive132* -XX:+ShenandoahOOMDuringEvacALot133* TestAllocObjects134*135* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions136* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive137* -XX:+ShenandoahAllocFailureALot138* TestAllocObjects139*140* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions141* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive142* TestAllocObjects143*/144145/*146* @test TestAllocObjects147* @summary Acceptance tests: collector can withstand allocation148* @key gc149*150* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions151* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu152* -XX:+ShenandoahVerify153* TestAllocObjects154*155* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions156* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu157* TestAllocObjects158*/159160import java.util.Random;161162public class TestAllocObjects {163164static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation165166static volatile Object sink;167168public static void main(String[] args) throws Exception {169long count = TARGET_MB * 1024 * 1024 / 16;170for (long c = 0; c < count; c++) {171sink = new Object();172}173}174175}176177178