47 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
48 * -Dprecise=false
49 * TestChurnNotifications
50 *
51 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
52 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
53 * -Dprecise=false
54 * TestChurnNotifications
55 *
56 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
57 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
58 * -Dprecise=false
59 * TestChurnNotifications
60 *
61 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
62 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
63 * -Dprecise=false
64 * TestChurnNotifications
65 */
66
67 import java.util.*;
68 import java.util.concurrent.atomic.*;
69 import javax.management.*;
70 import java.lang.management.*;
71 import javax.management.openmbean.*;
72
73 import com.sun.management.GarbageCollectionNotificationInfo;
74
75 public class TestChurnNotifications {
76
77 static final long HEAP_MB = 128; // adjust for test configuration above
78 static final long TARGET_MB = Long.getLong("target", 8_000); // 8 Gb allocation
79
80 // Should we track the churn precisely?
81 // Precise tracking is only reliable when GC is fully stop-the-world. Otherwise,
82 // we cannot tell, looking at heap used before/after, what was the GC churn.
83 static final boolean PRECISE = Boolean.getBoolean("precise");
84
85 static final long M = 1024 * 1024;
86
|
47 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
48 * -Dprecise=false
49 * TestChurnNotifications
50 *
51 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
52 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
53 * -Dprecise=false
54 * TestChurnNotifications
55 *
56 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
57 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
58 * -Dprecise=false
59 * TestChurnNotifications
60 *
61 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
62 * -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
63 * -Dprecise=false
64 * TestChurnNotifications
65 */
66
67 /*
68 * @test TestChurnNotifications
69 * @summary Check that MX notifications are reported for all cycles
70 * @requires vm.gc.Shenandoah & !vm.graal.enabled
71 *
72 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
73 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu -XX:ShenandoahGCHeuristics=aggressive
74 * -Dprecise=false
75 * TestChurnNotifications
76 *
77 * @run main/othervm -Xmx128m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
78 * -XX:+UseShenandoahGC -XX:ShenandoahGCMode=iu
79 * -Dprecise=false
80 * TestChurnNotifications
81 */
82
83 import java.util.*;
84 import java.util.concurrent.atomic.*;
85 import javax.management.*;
86 import java.lang.management.*;
87 import javax.management.openmbean.*;
88
89 import com.sun.management.GarbageCollectionNotificationInfo;
90
91 public class TestChurnNotifications {
92
93 static final long HEAP_MB = 128; // adjust for test configuration above
94 static final long TARGET_MB = Long.getLong("target", 8_000); // 8 Gb allocation
95
96 // Should we track the churn precisely?
97 // Precise tracking is only reliable when GC is fully stop-the-world. Otherwise,
98 // we cannot tell, looking at heap used before/after, what was the GC churn.
99 static final boolean PRECISE = Boolean.getBoolean("precise");
100
101 static final long M = 1024 * 1024;
102
|