< prev index next >
test/compiler/codecache/jmx/ThresholdNotificationsTest.java
Print this page
*** 52,66 ****
private volatile long counter;
private final BlobType btype;
public static void main(String[] args) {
for (BlobType bt : BlobType.getAvailable()) {
- if (CodeCacheUtils.isCodeHeapPredictable(bt)) {
new ThresholdNotificationsTest(bt).runTest();
}
}
- }
public ThresholdNotificationsTest(BlobType btype) {
this.btype = btype;
counter = 0L;
CodeCacheUtils.disableCollectionUsageThresholds();
--- 52,64 ----
*** 90,100 ****
for (int i = 0; i < iterationsCount; i++) {
CodeCacheUtils.hitUsageThreshold(bean, btype);
}
Asserts.assertTrue(
Utils.waitForCondition(
! () -> counter == iterationsCount, WAIT_TIME),
"Couldn't receive expected notifications count");
try {
((NotificationEmitter) ManagementFactory.getMemoryMXBean()).
removeNotificationListener(this);
} catch (ListenerNotFoundException ex) {
--- 88,100 ----
for (int i = 0; i < iterationsCount; i++) {
CodeCacheUtils.hitUsageThreshold(bean, btype);
}
Asserts.assertTrue(
Utils.waitForCondition(
! () -> (CodeCacheUtils.isCodeHeapPredictable(btype) ?
! (counter == iterationsCount) : (counter >= iterationsCount)),
! WAIT_TIME),
"Couldn't receive expected notifications count");
try {
((NotificationEmitter) ManagementFactory.getMemoryMXBean()).
removeNotificationListener(this);
} catch (ListenerNotFoundException ex) {
< prev index next >