2013-10-21 07:34:10 +00:00
|
|
|
/*
|
2023-05-11 13:59:37 +00:00
|
|
|
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
|
2016-10-17 22:54:12 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
|
|
|
*/
|
2013-10-21 07:34:10 +00:00
|
|
|
|
2019-01-28 14:53:56 +00:00
|
|
|
package gc;
|
|
|
|
|
2013-10-21 07:34:10 +00:00
|
|
|
/*
|
2021-11-11 07:07:58 +00:00
|
|
|
* @test id=Serial
|
2019-04-26 18:33:32 +00:00
|
|
|
* @requires vm.gc.Serial
|
2013-10-21 07:34:10 +00:00
|
|
|
* @summary Runs System.gc() with different flags.
|
2019-01-28 14:53:56 +00:00
|
|
|
* @run main/othervm -XX:+UseSerialGC gc.TestSystemGC
|
2021-11-11 07:07:58 +00:00
|
|
|
* @run main/othervm -XX:+UseSerialGC -XX:+UseLargePages gc.TestSystemGC
|
2019-04-26 18:33:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2021-11-11 07:07:58 +00:00
|
|
|
* @test id=Parallel
|
2019-04-26 18:33:32 +00:00
|
|
|
* @requires vm.gc.Parallel
|
|
|
|
* @summary Runs System.gc() with different flags.
|
2019-01-28 14:53:56 +00:00
|
|
|
* @run main/othervm -XX:+UseParallelGC gc.TestSystemGC
|
2021-11-11 07:07:58 +00:00
|
|
|
* @run main/othervm -XX:+UseParallelGC -XX:+UseLargePages gc.TestSystemGC
|
2019-04-26 18:33:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2021-11-11 07:07:58 +00:00
|
|
|
* @test id=G1
|
2019-04-26 18:33:32 +00:00
|
|
|
* @requires vm.gc.G1
|
|
|
|
* @summary Runs System.gc() with different flags.
|
2019-01-28 14:53:56 +00:00
|
|
|
* @run main/othervm -XX:+UseG1GC gc.TestSystemGC
|
|
|
|
* @run main/othervm -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent gc.TestSystemGC
|
2021-11-11 07:07:58 +00:00
|
|
|
* @run main/othervm -XX:+UseG1GC -XX:+UseLargePages gc.TestSystemGC
|
2021-06-22 07:44:25 +00:00
|
|
|
*/
|
2013-10-21 07:34:10 +00:00
|
|
|
|
2018-12-10 14:47:44 +00:00
|
|
|
/*
|
2021-11-11 07:07:58 +00:00
|
|
|
* @test id=Shenandoah
|
2020-07-10 18:52:35 +00:00
|
|
|
* @requires vm.gc.Shenandoah
|
2018-12-10 14:47:44 +00:00
|
|
|
* @summary Runs System.gc() with different flags.
|
2021-11-11 07:07:58 +00:00
|
|
|
* @run main/othervm -XX:+UseShenandoahGC gc.TestSystemGC
|
|
|
|
* @run main/othervm -XX:+UseShenandoahGC -XX:+ExplicitGCInvokesConcurrent gc.TestSystemGC
|
|
|
|
* @run main/othervm -XX:+UseShenandoahGC -XX:+UseLargePages gc.TestSystemGC
|
2018-12-10 14:47:44 +00:00
|
|
|
*/
|
2021-06-22 07:44:25 +00:00
|
|
|
|
2023-05-11 13:59:37 +00:00
|
|
|
/*
|
2024-10-30 11:05:07 +00:00
|
|
|
* @test id=Z
|
|
|
|
* @requires vm.gc.Z
|
2023-05-11 13:59:37 +00:00
|
|
|
* @comment ZGC will not start when LargePages cannot be allocated, therefore
|
|
|
|
* we do not run such configuration.
|
|
|
|
* @summary Runs System.gc() with different flags.
|
2024-10-30 11:05:07 +00:00
|
|
|
* @run main/othervm -XX:+UseZGC gc.TestSystemGC
|
2021-06-22 07:44:25 +00:00
|
|
|
*/
|
|
|
|
|
2013-10-21 07:34:10 +00:00
|
|
|
public class TestSystemGC {
|
|
|
|
public static void main(String args[]) throws Exception {
|
|
|
|
System.gc();
|
|
|
|
}
|
|
|
|
}
|