8137060: JMX memory management improvements

Reviewed-by: dfuchs, ahgross
This commit is contained in:
Shanliang Jiang 2015-10-06 09:20:12 +02:00
parent 57e9de3136
commit 683bd2b8b3

View File

@ -115,17 +115,10 @@ class MemoryImpl extends NotificationEmitterSupport
"Memory usage exceeds collection usage threshold" "Memory usage exceeds collection usage threshold"
}; };
private MBeanNotificationInfo[] notifInfo = null;
public MBeanNotificationInfo[] getNotificationInfo() { public MBeanNotificationInfo[] getNotificationInfo() {
synchronized (this) { return new MBeanNotificationInfo[] {
if (notifInfo == null) { new MBeanNotificationInfo(notifTypes, notifName, "Memory Notification")
notifInfo = new MBeanNotificationInfo[1]; };
notifInfo[0] = new MBeanNotificationInfo(notifTypes,
notifName,
"Memory Notification");
}
}
return notifInfo;
} }
private static String getNotifMsg(String notifType) { private static String getNotifMsg(String notifType) {