view patches/icedtea-6open-6651382.patch @ 1078:6790b974078e

2008-10-09 Matthias Klose <doko@ubuntu.com> * patches/icedtea-6open-6616825.patch: New. * patches/icedtea-6open-6651382.patch: New. * patches/icedtea-6open-6756202.patch: New. * Makefile.am: Apply patches.
author doko@ubuntu.com
date Thu, 09 Oct 2008 13:35:37 +0200
parents
children
line wrap: on
line source

--- openjdk/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.java	Tue Oct  7 08:43:32 2008
+++ openjdk/jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.java	Tue Oct  7 08:43:32 2008
@@ -26,7 +26,6 @@
 
 // java imports
 //
-import java.io.Serializable;
 import java.util.Map;
 
 // jmx imports
@@ -36,9 +35,7 @@
 
 // jdmk imports
 //
-import com.sun.jmx.snmp.agent.SnmpMib;
 
-import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryUsage;
 import java.lang.management.MemoryType;
 import java.lang.management.MemoryPoolMXBean;
@@ -73,8 +70,10 @@
         "jvmMemPoolEntry.getCollectionUsage";
     final static MemoryUsage ZEROS = new MemoryUsage(0,0,0,0);
 
-
-
+    final String entryMemoryTag;
+    final String entryPeakMemoryTag;
+    final String entryCollectMemoryTag;
+    
     MemoryUsage getMemoryUsage() {
         try {
             final Map<Object, Object> m = JvmContextFactory.getUserData();
@@ -81,10 +80,10 @@
 
             if (m != null) {
                 final MemoryUsage cached = (MemoryUsage)
-                    m.get(memoryTag);
+                    m.get(entryMemoryTag);
                 if (cached != null) {
-                    log.debug("getMemoryUsage",
-                          "jvmMemPoolEntry.getUsage found in cache.");
+                    log.debug("getMemoryUsage",entryMemoryTag+
+                          " found in cache.");
                     return cached;
                 }
 
@@ -91,7 +90,7 @@
                 MemoryUsage u = pool.getUsage();
                 if (u == null) u = ZEROS;
 
-                m.put(memoryTag,u);
+                m.put(entryMemoryTag,u);
                 return u;
             }
             // Should never come here.
@@ -113,11 +112,11 @@
 
             if (m != null) {
                 final MemoryUsage cached = (MemoryUsage)
-                    m.get(peakMemoryTag);
+                    m.get(entryPeakMemoryTag);
                 if (cached != null) {
                     if (log.isDebugOn())
                         log.debug("getPeakMemoryUsage",
-                              peakMemoryTag + " found in cache.");
+                              entryPeakMemoryTag + " found in cache.");
                     return cached;
                 }
 
@@ -124,7 +123,7 @@
                 MemoryUsage u = pool.getPeakUsage();
                 if (u == null) u = ZEROS;
 
-                m.put(peakMemoryTag,u);
+                m.put(entryPeakMemoryTag,u);
                 return u;
             }
             // Should never come here.
@@ -146,11 +145,11 @@
 
             if (m != null) {
                 final MemoryUsage cached = (MemoryUsage)
-                    m.get(collectMemoryTag);
+                    m.get(entryCollectMemoryTag);
                 if (cached != null) {
                     if (log.isDebugOn())
                         log.debug("getCollectMemoryUsage",
-                                  collectMemoryTag + " found in cache.");
+                                  entryCollectMemoryTag + " found in cache.");
                     return cached;
                 }
 
@@ -157,7 +156,7 @@
                 MemoryUsage u = pool.getCollectionUsage();
                 if (u == null) u = ZEROS;
 
-                m.put(collectMemoryTag,u);
+                m.put(entryCollectMemoryTag,u);
                 return u;
             }
             // Should never come here.
@@ -179,9 +178,12 @@
     /**
      * Constructor for the "JvmMemPoolEntry" group.
      */
-    public JvmMemPoolEntryImpl(MemoryPoolMXBean mp, int index) {
+    public JvmMemPoolEntryImpl(MemoryPoolMXBean mp, final int index) {
         this.pool=mp;
         this.jvmMemPoolIndex = index;
+        this.entryMemoryTag = memoryTag + "." + index;
+        this.entryPeakMemoryTag = peakMemoryTag + "." + index;
+        this.entryCollectMemoryTag = collectMemoryTag + "." + index;
     }
 
     /**