8137060: JMX memory management improvements
authorsjiang
Tue, 06 Oct 2015 09:20:12 +0200
changeset 35288 d4d492397105
parent 35287 e59d934ce2ba
child 35289 1031cb912792
8137060: JMX memory management improvements Reviewed-by: dfuchs, ahgross
jdk/src/java.management/share/classes/sun/management/MemoryImpl.java
--- a/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java	Fri Oct 02 11:50:20 2015 +0300
+++ b/jdk/src/java.management/share/classes/sun/management/MemoryImpl.java	Tue Oct 06 09:20:12 2015 +0200
@@ -115,17 +115,10 @@
         "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) {