CollectionUsageThreshold.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:jdk8u-jdk 作者:
@Override
public void handleNotification(Notification notif, Object handback) {
    String type = notif.getType();
    if (MEMORY_THRESHOLD_EXCEEDED.equals(type) ||
        MEMORY_COLLECTION_THRESHOLD_EXCEEDED.equals(type)) {
        MemoryNotificationInfo minfo = MemoryNotificationInfo.
            from((CompositeData) notif.getUserData());

        MemoryUtil.printMemoryNotificationInfo(minfo, type);
        PoolRecord pr = (PoolRecord) result.get(minfo.getPoolName());
        if (pr == null) {
            throw new RuntimeException("Pool " + minfo.getPoolName() +
                " is not selected");
        }
        if (!MEMORY_COLLECTION_THRESHOLD_EXCEEDED.equals(type)) {
            throw new RuntimeException("Pool " + minfo.getPoolName() +
                " got unexpected notification type: " +
                type);
        }
        pr.addNotification(minfo);
        System.out.println("notifying the checker thread to check result");
        signals.release();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号