Path: blob/master/test/hotspot/jtreg/gc/TestSystemGC.java
64438 views
/*1* Copyright (c) 2013, 2020, Oracle and/or its affiliates. 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*/2223package gc;2425/*26* @test id=Serial27* @requires vm.gc.Serial28* @summary Runs System.gc() with different flags.29* @run main/othervm -XX:+UseSerialGC gc.TestSystemGC30* @run main/othervm -XX:+UseSerialGC -XX:+UseLargePages gc.TestSystemGC31*/3233/*34* @test id=Parallel35* @requires vm.gc.Parallel36* @summary Runs System.gc() with different flags.37* @run main/othervm -XX:+UseParallelGC gc.TestSystemGC38* @run main/othervm -XX:+UseParallelGC -XX:+UseLargePages gc.TestSystemGC39*/4041/*42* @test id=G143* @requires vm.gc.G144* @summary Runs System.gc() with different flags.45* @run main/othervm -XX:+UseG1GC gc.TestSystemGC46* @run main/othervm -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent gc.TestSystemGC47* @run main/othervm -XX:+UseG1GC -XX:+UseLargePages gc.TestSystemGC48*/4950/*51* @test id=Shenandoah52* @requires vm.gc.Shenandoah53* @summary Runs System.gc() with different flags.54* @run main/othervm -XX:+UseShenandoahGC gc.TestSystemGC55* @run main/othervm -XX:+UseShenandoahGC -XX:+ExplicitGCInvokesConcurrent gc.TestSystemGC56* @run main/othervm -XX:+UseShenandoahGC -XX:+UseLargePages gc.TestSystemGC57*/5859/*60* @test id=Z61* @requires vm.gc.Z62* @comment ZGC will not start when LargePages cannot be allocated, therefore63* we do not run such configuration.64* @summary Runs System.gc() with different flags.65* @run main/othervm -XX:+UseZGC gc.TestSystemGC66*/6768public class TestSystemGC {69public static void main(String args[]) throws Exception {70System.gc();71}72}737475