Path: blob/master/test/hotspot/jtreg/gc/shenandoah/TestAllocObjects.java
40942 views
/*1* Copyright (c) 2016, 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 TestAllocObjects26* @summary Acceptance tests: collector can withstand allocation27* @requires vm.gc.Shenandoah28*29* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions30* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive31* -XX:+ShenandoahDegeneratedGC -XX:+ShenandoahVerify32* TestAllocObjects33*34* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions35* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive36* -XX:-ShenandoahDegeneratedGC -XX:+ShenandoahVerify37* TestAllocObjects38*39* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions40* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive41* -XX:+ShenandoahDegeneratedGC42* TestAllocObjects43*44* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions45* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive46* -XX:-ShenandoahDegeneratedGC47* TestAllocObjects48*/4950/*51* @test TestAllocObjects52* @summary Acceptance tests: collector can withstand allocation53* @requires vm.gc.Shenandoah54*55* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions56* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive57* -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify58* TestAllocObjects59*60* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions61* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive62* -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify63* TestAllocObjects64*65* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions66* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive67* -XX:+ShenandoahOOMDuringEvacALot68* TestAllocObjects69*70* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions71* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive72* -XX:+ShenandoahAllocFailureALot73* TestAllocObjects74*75* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions76* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive77* TestAllocObjects78*79* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions80* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive81* -XX:+ShenandoahSuspendibleWorkers82* TestAllocObjects83*84*/8586/*87* @test TestAllocObjects88* @summary Acceptance tests: collector can withstand allocation89* @requires vm.gc.Shenandoah90*91* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions92* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive93* -XX:+ShenandoahVerify94* TestAllocObjects95*96* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions97* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive98* TestAllocObjects99*100* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions101* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive102* -XX:+ShenandoahSuspendibleWorkers103* TestAllocObjects104*/105106/*107* @test TestAllocObjects108* @summary Acceptance tests: collector can withstand allocation109* @requires vm.gc.Shenandoah110*111* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions112* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static113* TestAllocObjects114*115* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions116* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static117* -XX:+ShenandoahSuspendibleWorkers118* TestAllocObjects119*/120121/*122* @test TestAllocObjects123* @summary Acceptance tests: collector can withstand allocation124* @requires vm.gc.Shenandoah125*126* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions127* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact128* TestAllocObjects129*130* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions131* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact132* -XX:+ShenandoahSuspendibleWorkers133* TestAllocObjects134*/135136/*137* @test TestAllocObjects138* @summary Acceptance tests: collector can withstand allocation139* @requires vm.gc.Shenandoah140*141* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions142* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive143* -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify144* TestAllocObjects145*146* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions147* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive148* -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify149* TestAllocObjects150*151* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions152* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive153* -XX:+ShenandoahOOMDuringEvacALot154* TestAllocObjects155*156* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions157* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive158* -XX:+ShenandoahAllocFailureALot159* TestAllocObjects160*161* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions162* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive163* TestAllocObjects164*/165166/*167* @test TestAllocObjects168* @summary Acceptance tests: collector can withstand allocation169* @requires vm.gc.Shenandoah170*171* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions172* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu173* -XX:+ShenandoahVerify174* TestAllocObjects175*176* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions177* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu178* TestAllocObjects179*180* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions181* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu182* -XX:+ShenandoahSuspendibleWorkers183* TestAllocObjects184*/185186public class TestAllocObjects {187188static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation189190static volatile Object sink;191192public static void main(String[] args) throws Exception {193long count = TARGET_MB * 1024 * 1024 / 16;194for (long c = 0; c < count; c++) {195sink = new Object();196}197}198199}200201202