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