1 /*
   2  * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 package gc;
  25 
  26 /*
  27  * @test TestSystemGCSerial
  28  * @key gc
  29  * @requires vm.gc.Serial
  30  * @summary Runs System.gc() with different flags.
  31  * @run main/othervm -XX:+UseSerialGC gc.TestSystemGC
  32  */
  33 
  34 /*
  35  * @test TestSystemGCParallel
  36  * @key gc
  37  * @requires vm.gc.Parallel
  38  * @summary Runs System.gc() with different flags.
  39  * @run main/othervm -XX:+UseParallelGC gc.TestSystemGC
  40  * @run main/othervm -XX:+UseParallelGC -XX:-UseParallelOldGC gc.TestSystemGC
  41  */
  42 
  43 /*
  44  * @test TestSystemGCG1
  45  * @key gc
  46  * @requires vm.gc.G1
  47  * @summary Runs System.gc() with different flags.
  48  * @run main/othervm -XX:+UseG1GC gc.TestSystemGC
  49  * @run main/othervm -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent gc.TestSystemGC
  50  * @run main/othervm -XX:+UseLargePages gc.TestSystemGC
  51  * @run main/othervm -XX:+UseLargePages -XX:+UseLargePagesInMetaspace gc.TestSystemGC
  52  */
  53 
  54 /*
  55  * @test TestSystemGCShenandoah
  56  * @key gc
  57  * @requires vm.gc.Shenandoah & !vm.graal.enabled
  58  * @summary Runs System.gc() with different flags.
  59  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC gc.TestSystemGC
  60  * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+UseShenandoahGC -XX:+ExplicitGCInvokesConcurrent gc.TestSystemGC
  61  */
  62 public class TestSystemGC {
  63   public static void main(String args[]) throws Exception {
  64     System.gc();
  65   }
  66 }