< prev index next >

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

Print this page

  1 /*
  2  * Copyright (c) 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  *

 46  * @library /test/lib
 47  *
 48  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 49  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
 50  *      -Dtarget=1000
 51  *      TestDynamicSoftMaxHeapSize
 52  */
 53 
 54 /*
 55  * @test id=adaptive
 56  * @requires vm.gc.Shenandoah
 57  * @library /test/lib
 58  *
 59  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 60  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
 61  *      -Dtarget=10000
 62  *      TestDynamicSoftMaxHeapSize
 63  */
 64 
 65 /*
 66  * @test id=static
 67  * @requires vm.gc.Shenandoah
 68  * @library /test/lib
 69  *
 70  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 71  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
 72  *      -Dtarget=10000
 73  *      TestDynamicSoftMaxHeapSize
 74  */
 75 
 76 /*
 77  * @test id=compact
 78  * @requires vm.gc.Shenandoah
 79  * @library /test/lib
 80  *
 81  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 82  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
 83  *      -Dtarget=1000
 84  *     TestDynamicSoftMaxHeapSize
 85  */
 86 
 87 /*
 88  * @test id=iu-aggressive
 89  * @requires vm.gc.Shenandoah
 90  * @library /test/lib
 91  *
 92  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 93  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
 94  *      -Dtarget=1000
 95  *      TestDynamicSoftMaxHeapSize
 96  */
 97 
 98 /*
 99  * @test id=iu
100  * @requires vm.gc.Shenandoah
101  * @library /test/lib
102  *
103  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
104  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
105  *      -Dtarget=10000
106  *      TestDynamicSoftMaxHeapSize
107  */
108 
109 import java.util.Random;
110 import jdk.test.lib.Utils;
111 import jdk.test.lib.process.OutputAnalyzer;
112 import jdk.test.lib.process.ProcessTools;
113 import jdk.test.lib.dcmd.PidJcmdExecutor;
114 
115 public class TestDynamicSoftMaxHeapSize {
116 
117     static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation
118     static final long STRIDE = 10_000_000;
119 
120     static volatile Object sink;
121 
122     public static void main(String[] args) throws Exception {
123         long count = TARGET_MB * 1024 * 1024 / 16;
124         Random r = Utils.getRandomInstance();
125         PidJcmdExecutor jcmd = new PidJcmdExecutor();
126 

  1 /*
  2  * Copyright (c) 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  *

 47  * @library /test/lib
 48  *
 49  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 50  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
 51  *      -Dtarget=1000
 52  *      TestDynamicSoftMaxHeapSize
 53  */
 54 
 55 /*
 56  * @test id=adaptive
 57  * @requires vm.gc.Shenandoah
 58  * @library /test/lib
 59  *
 60  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 61  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
 62  *      -Dtarget=10000
 63  *      TestDynamicSoftMaxHeapSize
 64  */
 65 
 66 /*
 67  * @test id=generational
 68  * @requires vm.gc.Shenandoah
 69  * @library /test/lib
 70  *
 71  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 72  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive -XX:ShenandoahGCMode=generational
 73  *      -Dtarget=10000
 74  *      TestDynamicSoftMaxHeapSize
 75  */
 76 
 77 /*
 78  * @test id=static











 79  * @requires vm.gc.Shenandoah
 80  * @library /test/lib
 81  *
 82  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 83  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
 84  *      -Dtarget=10000
 85  *      TestDynamicSoftMaxHeapSize
 86  */
 87 
 88 /*
 89  * @test id=compact
 90  * @requires vm.gc.Shenandoah
 91  * @library /test/lib
 92  *
 93  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
 94  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
 95  *      -Dtarget=1000
 96  *     TestDynamicSoftMaxHeapSize
 97  */
 98 
 99 import java.util.Random;
100 import jdk.test.lib.Utils;
101 import jdk.test.lib.process.OutputAnalyzer;
102 import jdk.test.lib.process.ProcessTools;
103 import jdk.test.lib.dcmd.PidJcmdExecutor;
104 
105 public class TestDynamicSoftMaxHeapSize {
106 
107     static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation
108     static final long STRIDE = 10_000_000;
109 
110     static volatile Object sink;
111 
112     public static void main(String[] args) throws Exception {
113         long count = TARGET_MB * 1024 * 1024 / 16;
114         Random r = Utils.getRandomInstance();
115         PidJcmdExecutor jcmd = new PidJcmdExecutor();
116 
< prev index next >