< prev index next >

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

Print this page
rev 58672 : Shenandoah: New incremental-update mode


  84  *      TestAllocObjectArrays
  85  *
  86  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
  87  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
  88  *      TestAllocObjectArrays
  89  *
  90  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
  91  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
  92  *      TestAllocObjectArrays
  93  *
  94  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
  95  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
  96  *      TestAllocObjectArrays
  97  *
  98  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
  99  *      -XX:+UseShenandoahGC
 100  *      -XX:-UseTLAB -XX:+ShenandoahVerify
 101  *      TestAllocObjectArrays
 102  */
 103 








































 104 import java.util.Random;
 105 
 106 public class TestAllocObjectArrays {
 107 
 108     static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation
 109 
 110     static volatile Object sink;
 111 
 112     public static void main(String[] args) throws Exception {
 113         final int min = 0;
 114         final int max = 384 * 1024;
 115         long count = TARGET_MB * 1024 * 1024 / (16 + 4 * (min + (max - min) / 2));
 116 
 117         Random r = new Random();
 118         for (long c = 0; c < count; c++) {
 119             sink = new Object[min + r.nextInt(max - min)];
 120         }
 121     }
 122 
 123 }


  84  *      TestAllocObjectArrays
  85  *
  86  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
  87  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
  88  *      TestAllocObjectArrays
  89  *
  90  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
  91  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
  92  *      TestAllocObjectArrays
  93  *
  94  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
  95  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
  96  *      TestAllocObjectArrays
  97  *
  98  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
  99  *      -XX:+UseShenandoahGC
 100  *      -XX:-UseTLAB -XX:+ShenandoahVerify
 101  *      TestAllocObjectArrays
 102  */
 103 
 104 /*
 105  * @test TestAllocObjectArrays
 106  * @summary Acceptance tests: collector can withstand allocation
 107  * @key gc
 108  * @requires vm.gc.Shenandoah & !vm.graal.enabled
 109  *
 110  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
 111  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
 112  *      -XX:+ShenandoahOOMDuringEvacALot -XX:+ShenandoahVerify
 113  *      TestAllocObjectArrays
 114  *
 115  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
 116  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
 117  *      -XX:+ShenandoahAllocFailureALot -XX:+ShenandoahVerify
 118  *      TestAllocObjectArrays
 119  *
 120  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
 121  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
 122  *      -XX:+ShenandoahOOMDuringEvacALot
 123  *      TestAllocObjectArrays
 124  *
 125  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
 126  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
 127  *      -XX:+ShenandoahAllocFailureALot
 128  *      TestAllocObjectArrays
 129  *
 130  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
 131  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
 132  *      TestAllocObjectArrays
 133  *
 134  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
 135  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
 136  *      -XX:+ShenandoahVerify
 137  *      TestAllocObjectArrays
 138  *
 139  * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -Xmx1g -Xms1g
 140  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
 141  *      TestAllocObjectArrays
 142  */
 143 
 144 import java.util.Random;
 145 
 146 public class TestAllocObjectArrays {
 147 
 148     static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation
 149 
 150     static volatile Object sink;
 151 
 152     public static void main(String[] args) throws Exception {
 153         final int min = 0;
 154         final int max = 384 * 1024;
 155         long count = TARGET_MB * 1024 * 1024 / (16 + 4 * (min + (max - min) / 2));
 156 
 157         Random r = new Random();
 158         for (long c = 0; c < count; c++) {
 159             sink = new Object[min + r.nextInt(max - min)];
 160         }
 161     }
 162 
 163 }
< prev index next >