Path: blob/master/test/hotspot/jtreg/gc/shenandoah/TestRegionSampling.java
40942 views
/*1* Copyright (c) 2017, 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 TestRegionSampling26* @requires vm.gc.Shenandoah27*28* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling29* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive30* -XX:+ShenandoahDegeneratedGC31* TestRegionSampling32*33* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling34* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive35* -XX:-ShenandoahDegeneratedGC36* TestRegionSampling37*/3839/*40* @test TestRegionSampling41* @requires vm.gc.Shenandoah42*43* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling44* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive45* TestRegionSampling46*/4748/*49* @test TestRegionSampling50* @requires vm.gc.Shenandoah51*52* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling53* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static54* TestRegionSampling55*/5657/*58* @test TestRegionSampling59* @requires vm.gc.Shenandoah60*61* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling62* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact63* TestRegionSampling64*/6566/*67* @test TestRegionSampling68* @requires vm.gc.Shenandoah69*70* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling71* -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive72* TestRegionSampling73*/7475/*76* @test TestRegionSampling77* @requires vm.gc.Shenandoah78*79* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling80* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive81* TestRegionSampling82*/8384/*85* @test TestRegionSampling86* @requires vm.gc.Shenandoah87*88* @run main/othervm -Xmx1g -Xms1g -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+ShenandoahRegionSampling89* -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu90* TestRegionSampling91*92*/9394public class TestRegionSampling {9596static final long TARGET_MB = Long.getLong("target", 2_000); // 2 Gb allocation9798static volatile Object sink;99100public static void main(String[] args) throws Exception {101long count = TARGET_MB * 1024 * 1024 / 16;102for (long c = 0; c < count; c++) {103sink = new Object();104}105}106107}108109110