< prev index next >

test/hotspot/jtreg/gc/shenandoah/TestVerifyJCStress.java

Print this page

  1 /*
  2  * Copyright (c) 2017, 2020, Red Hat, Inc. 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  *

 39  *      -XX:-ShenandoahDegeneratedGC -XX:+ShenandoahVerify
 40  *      TestVerifyJCStress
 41  */
 42 
 43 /*
 44  * @test id=default
 45  * @summary Tests that we pass at least one jcstress-like test with all verification turned on
 46  * @requires vm.gc.Shenandoah
 47  * @modules java.base/jdk.internal.misc
 48  *          java.management
 49  *
 50  * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions
 51  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
 52  *      -XX:+ShenandoahVerify
 53  *      TestVerifyJCStress
 54  *
 55  * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions
 56  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
 57  *      -XX:+ShenandoahVerify
 58  *      TestVerifyJCStress





 59  */
 60 
 61 import java.util.*;
 62 import java.util.concurrent.*;
 63 import java.util.concurrent.locks.*;
 64 
 65 public class TestVerifyJCStress {
 66 
 67     public static void main(String[] args) throws Exception {
 68         ExecutorService service = Executors.newFixedThreadPool(
 69                 2,
 70                 r -> {
 71                     Thread t = new Thread(r);
 72                     t.setDaemon(true);
 73                     return t;
 74                 }
 75         );
 76 
 77         for (int c = 0; c < 10000; c++) {
 78             final Test[] tests = new Test[10000];

  1 /*
  2  * Copyright (c) 2017, 2020, Red Hat, Inc. All rights reserved.
  3  * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
  4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  5  *
  6  * This code is free software; you can redistribute it and/or modify it
  7  * under the terms of the GNU General Public License version 2 only, as
  8  * published by the Free Software Foundation.
  9  *
 10  * This code is distributed in the hope that it will be useful, but WITHOUT
 11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 13  * version 2 for more details (a copy is included in the LICENSE file that
 14  * accompanied this code).
 15  *
 16  * You should have received a copy of the GNU General Public License version
 17  * 2 along with this work; if not, write to the Free Software Foundation,
 18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 19  *
 20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 21  * or visit www.oracle.com if you need additional information or have any
 22  * questions.
 23  *

 40  *      -XX:-ShenandoahDegeneratedGC -XX:+ShenandoahVerify
 41  *      TestVerifyJCStress
 42  */
 43 
 44 /*
 45  * @test id=default
 46  * @summary Tests that we pass at least one jcstress-like test with all verification turned on
 47  * @requires vm.gc.Shenandoah
 48  * @modules java.base/jdk.internal.misc
 49  *          java.management
 50  *
 51  * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions
 52  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
 53  *      -XX:+ShenandoahVerify
 54  *      TestVerifyJCStress
 55  *
 56  * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions
 57  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
 58  *      -XX:+ShenandoahVerify
 59  *      TestVerifyJCStress
 60  *
 61  * @run main/othervm -Xmx1g -Xms1g -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions
 62  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive -XX:ShenandoahGCMode=generational
 63  *      -XX:+ShenandoahVerify
 64  *      TestVerifyJCStress
 65  */
 66 
 67 import java.util.*;
 68 import java.util.concurrent.*;
 69 import java.util.concurrent.locks.*;
 70 
 71 public class TestVerifyJCStress {
 72 
 73     public static void main(String[] args) throws Exception {
 74         ExecutorService service = Executors.newFixedThreadPool(
 75                 2,
 76                 r -> {
 77                     Thread t = new Thread(r);
 78                     t.setDaemon(true);
 79                     return t;
 80                 }
 81         );
 82 
 83         for (int c = 0; c < 10000; c++) {
 84             final Test[] tests = new Test[10000];
< prev index next >