Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/test/gc/shenandoah/TestRegionSampling.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 TestRegionSampling25* @key gc26*27* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling28* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive29* -XX:+ShenandoahDegeneratedGC30* TestRegionSampling31*32* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling33* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive34* -XX:-ShenandoahDegeneratedGC35* TestRegionSampling36*/3738/*39* @test TestRegionSampling40* @key gc41*42* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling43* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive44* TestRegionSampling45*/4647/*48* @test TestRegionSampling49* @key gc50*51* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling52* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static53* TestRegionSampling54*/5556/*57* @test TestRegionSampling58* @key gc59*60* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling61* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact62* TestRegionSampling63*/6465/*66* @test TestRegionSampling67* @key gc68*69* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling70* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive71* TestRegionSampling72*/7374/*75* @test TestRegionSampling76* @key gc77*78* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling79* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive80* TestRegionSampling81*/8283/*84* @test TestRegionSampling85* @key gc86*87* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling88* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu89* TestRegionSampling90*91*/9293public class TestRegionSampling {9495static final long TARGET_MB = Long.getLong("target", 2_000); // 2 Gb allocation9697static volatile Object sink;9899public static void main(String[] args) throws Exception {100long count = TARGET_MB * 1024 * 1024 / 16;101for (long c = 0; c < count; c++) {102sink = new Object();103}104}105106}107108109