45 * @key gc
46 * @requires vm.gc.Shenandoah & !vm.graal.enabled
47 *
48 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
49 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
50 * TestPauseNotifications
51 *
52 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
53 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
54 * TestPauseNotifications
55 *
56 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
57 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
58 * TestPauseNotifications
59 *
60 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
61 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
62 * TestPauseNotifications
63 */
64
65 import java.util.*;
66 import java.util.concurrent.atomic.*;
67 import javax.management.*;
68 import java.lang.management.*;
69 import javax.management.openmbean.*;
70
71 import com.sun.management.GarbageCollectionNotificationInfo;
72
73 public class TestPauseNotifications {
74
75 static final long HEAP_MB = 128; // adjust for test configuration above
76 static final long TARGET_MB = Long.getLong("target", 8_000); // 8 Gb allocation
77
78 static volatile Object sink;
79
80 public static void main(String[] args) throws Exception {
81 final AtomicLong pausesDuration = new AtomicLong();
82 final AtomicLong cyclesDuration = new AtomicLong();
83
84 NotificationListener listener = new NotificationListener() {
|
45 * @key gc
46 * @requires vm.gc.Shenandoah & !vm.graal.enabled
47 *
48 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
49 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
50 * TestPauseNotifications
51 *
52 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
53 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
54 * TestPauseNotifications
55 *
56 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
57 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
58 * TestPauseNotifications
59 *
60 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
61 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
62 * TestPauseNotifications
63 */
64
65 /*
66 * @test TestPauseNotifications
67 * @summary Check that MX notifications are reported for all cycles
68 * @key gc
69 * @requires vm.gc.Shenandoah & !vm.graal.enabled
70 *
71 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
72 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
73 * TestPauseNotifications
74 *
75 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
76 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
77 * TestPauseNotifications
78 */
79
80 import java.util.*;
81 import java.util.concurrent.atomic.*;
82 import javax.management.*;
83 import java.lang.management.*;
84 import javax.management.openmbean.*;
85
86 import com.sun.management.GarbageCollectionNotificationInfo;
87
88 public class TestPauseNotifications {
89
90 static final long HEAP_MB = 128; // adjust for test configuration above
91 static final long TARGET_MB = Long.getLong("target", 8_000); // 8 Gb allocation
92
93 static volatile Object sink;
94
95 public static void main(String[] args) throws Exception {
96 final AtomicLong pausesDuration = new AtomicLong();
97 final AtomicLong cyclesDuration = new AtomicLong();
98
99 NotificationListener listener = new NotificationListener() {
|