public MemoryMonitor() {
LOG.info("initializing");
this.springContextId = "Unknown";
MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
NotificationEmitter emitter = (NotificationEmitter) mbean;
emitter.addNotificationListener(new NotificationListener() {
public void handleNotification(Notification n, Object hb) {
if (n.getType().equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED)) {
long maxMemory = tenuredGenPool.getUsage().getMax();
long usedMemory = tenuredGenPool.getUsage().getUsed();
for (Listener listener : listeners) {
listener.memoryUsageLow(springContextId, usedMemory, maxMemory);
}
}
}
}, null, null);
}
MemoryMonitor.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:kuali_rice
作者:
评论列表
文章目录