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 */
23
24 import com.oracle.java.testlibrary.Asserts;
25 import com.oracle.java.testlibrary.Utils;
26 import java.lang.management.ManagementFactory;
27 import java.lang.management.MemoryNotificationInfo;
28 import java.lang.management.MemoryPoolMXBean;
29 import javax.management.ListenerNotFoundException;
30 import javax.management.Notification;
31 import javax.management.NotificationEmitter;
32 import javax.management.NotificationListener;
33 import sun.hotspot.code.BlobType;
34
35 /*
36 * @test ThresholdNotificationsTest
37 * @library /testlibrary /../../test/lib
38 * @build ThresholdNotificationsTest
39 * @run main ClassFileInstaller sun.hotspot.WhiteBox
40 * sun.hotspot.WhiteBox$WhiteBoxPermission
41 * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
42 * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
43 * -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::*
44 * ThresholdNotificationsTest
45 * @summary testing of getUsageThreshold()
46 */
47 public class ThresholdNotificationsTest implements NotificationListener {
48
49 private final static long WAIT_TIME = 10000L;
50 private volatile long counter;
51 private final BlobType btype;
52
53 public static void main(String[] args) {
54 for (BlobType bt : BlobType.getAvailable()) {
55 if (CodeCacheUtils.isCodeHeapPredictable(bt)) {
56 new ThresholdNotificationsTest(bt).runTest();
57 }
58 }
|
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 */
23
24 import com.oracle.java.testlibrary.Asserts;
25 import com.oracle.java.testlibrary.Utils;
26 import java.lang.management.ManagementFactory;
27 import java.lang.management.MemoryNotificationInfo;
28 import java.lang.management.MemoryPoolMXBean;
29 import javax.management.ListenerNotFoundException;
30 import javax.management.Notification;
31 import javax.management.NotificationEmitter;
32 import javax.management.NotificationListener;
33 import sun.hotspot.code.BlobType;
34
35 /*
36 * @test ThresholdNotificationsTest
37 * @library /testlibrary /../../test/lib
38 * @build com.oracle.java.testlibrary.* ThresholdNotificationsTest
39 * @run main ClassFileInstaller sun.hotspot.WhiteBox
40 * sun.hotspot.WhiteBox$WhiteBoxPermission
41 * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
42 * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
43 * -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::*
44 * ThresholdNotificationsTest
45 * @summary testing of getUsageThreshold()
46 */
47 public class ThresholdNotificationsTest implements NotificationListener {
48
49 private final static long WAIT_TIME = 10000L;
50 private volatile long counter;
51 private final BlobType btype;
52
53 public static void main(String[] args) {
54 for (BlobType bt : BlobType.getAvailable()) {
55 if (CodeCacheUtils.isCodeHeapPredictable(bt)) {
56 new ThresholdNotificationsTest(bt).runTest();
57 }
58 }
|