From 683bd2b8b384f40885194557b5f743204b59de42 Mon Sep 17 00:00:00 2001 From: Shanliang Jiang Date: Tue, 6 Oct 2015 09:20:12 +0200 Subject: [PATCH] 8137060: JMX memory management improvements Reviewed-by: dfuchs, ahgross --- .../share/classes/sun/management/MemoryImpl.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java b/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java index 00d68d4a022..c707c4fba73 100644 --- a/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java +++ b/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java @@ -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) {