< prev index next >

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

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


  61  *
  62  * @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
  63  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
  64  *      -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4
  65  *      -Dtarget=1000
  66  *      TestGCThreadGroups
  67  *
  68  * @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
  69  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
  70  *      -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4
  71  *      -Dtarget=100
  72  *      TestGCThreadGroups
  73  *
  74  * @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
  75  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
  76  *      -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4
  77  *      -Dtarget=100
  78  *      TestGCThreadGroups
  79  */
  80 



















  81 public class TestGCThreadGroups {
  82 
  83     static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation, around 1K cycles to handle
  84     static final long STRIDE = 100_000;
  85 
  86     static volatile Object sink;
  87 
  88     public static void main(String[] args) throws Exception {
  89         long count = TARGET_MB * 1024 * 1024 / 16;
  90         for (long c = 0; c < count; c += STRIDE) {
  91             for (long s = 0; s < STRIDE; s++) {
  92                 sink = new Object();
  93             }
  94             Thread.sleep(1);
  95         }
  96     }
  97 
  98 }


  61  *
  62  * @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
  63  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
  64  *      -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4
  65  *      -Dtarget=1000
  66  *      TestGCThreadGroups
  67  *
  68  * @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
  69  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
  70  *      -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4
  71  *      -Dtarget=100
  72  *      TestGCThreadGroups
  73  *
  74  * @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
  75  *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
  76  *      -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4
  77  *      -Dtarget=100
  78  *      TestGCThreadGroups
  79  */
  80 
  81 /**
  82  * @test TestGCThreadGroups
  83  * @summary Test Shenandoah GC uses concurrent/parallel threads correctly
  84  * @key gc
  85  * @requires vm.gc.Shenandoah & !vm.graal.enabled
  86  *
  87  * @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
  88  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
  89  *      -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4
  90  *      -Dtarget=1000
  91  *      TestGCThreadGroups
  92  *
  93  * @run main/othervm -Xmx16m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
  94  *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
  95  *      -XX:ConcGCThreads=2 -XX:ParallelGCThreads=4
  96  *      -Dtarget=1000
  97  *      TestGCThreadGroups
  98 */
  99 
 100 public class TestGCThreadGroups {
 101 
 102     static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation, around 1K cycles to handle
 103     static final long STRIDE = 100_000;
 104 
 105     static volatile Object sink;
 106 
 107     public static void main(String[] args) throws Exception {
 108         long count = TARGET_MB * 1024 * 1024 / 16;
 109         for (long c = 0; c < count; c += STRIDE) {
 110             for (long s = 0; s < STRIDE; s++) {
 111                 sink = new Object();
 112             }
 113             Thread.sleep(1);
 114         }
 115     }
 116 
 117 }
< prev index next >