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"
};
private MBeanNotificationInfo[] notifInfo = null;
public MBeanNotificationInfo[] getNotificationInfo() {
synchronized (this) {
if (notifInfo == null) {
notifInfo = new MBeanNotificationInfo[1];
notifInfo[0] = new MBeanNotificationInfo(notifTypes,
notifName,
"Memory Notification");
}
}
return notifInfo;
return new MBeanNotificationInfo[] {
new MBeanNotificationInfo(notifTypes, notifName, "Memory Notification")
};
}
private static String getNotifMsg(String notifType) {