Skip to main content

[memorypoolview~source-code-repository:68c0faf3] Added Hotspot garbage collectors

  • From:
  • To:
  • Subject: [memorypoolview~source-code-repository:68c0faf3] Added Hotspot garbage collectors
  • Date: Tue, 12 Mar 2013 19:11:40 +0000

Project:    memorypoolview
Repository: source-code-repository
Revision:   68c0faf3c9ec4a8fdc23566934d69910a0e0f3dd
Author:     pingtimeout
Date:       2013-03-12 19:12:25 UTC
Link:       

Log Message:
------------
Removed duplicated data (gc name in model)
Added Hotspot garbage collectors


Revisions:
----------
243fd8b0ad8e4791869d2349dcb7bb22dcd85027
68c0faf3c9ec4a8fdc23566934d69910a0e0f3dd


Modified Paths:
---------------
src/com/kodewerk/visualvm/memorypools/gc/GarbageCollector.java
src/com/kodewerk/visualvm/memorypools/gc/GarbageCollectorModel.java
src/com/kodewerk/visualvm/memorypools/PanelPositions.java


Diffs:
------
diff --git a/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollector.java 
b/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollector.java
index a8fa065..b9d36e9 100644
--- a/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollector.java
+++ b/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollector.java
@@ -17,6 +17,10 @@ public enum GarbageCollector {
         return generation;
     }
 
+    public String getName() {
+        return name;
+    }
+
     static GarbageCollector fromName(String name) {
         for (GarbageCollector garbageCollector : values()) {
             if(garbageCollector.name.equals(name)) {
diff --git 
a/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollectorModel.java 
b/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollectorModel.java
index 87d87dc..7d21dbe 100644
--- a/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollectorModel.java
+++ b/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollectorModel.java
@@ -13,9 +13,7 @@ import java.util.HashSet;
 import java.util.Set;
 
 public class GarbageCollectorModel implements MBeanCacheListener {
-
     private final Set<GarbageCollectorModelListener> listeners = new 
HashSet<GarbageCollectorModelListener>();
-    private final String name;
     private final ObjectName mbeanName;
     private final MBeanServerConnection mbeanServerConnection;
     private final GarbageCollector garbageCollector;
@@ -26,7 +24,7 @@ public class GarbageCollectorModel implements 
MBeanCacheListener {
         this.mbeanName = mbeanName;
         this.mbeanServerConnection = mbeanServerConnection;
         
CachedMBeanServerConnectionFactory.getCachedMBeanServerConnection(model, 
2000).addMBeanCacheListener(this);
-        name = mbeanServerConnection.getAttribute(mbeanName, 
"Name").toString();
+        String name = mbeanServerConnection.getAttribute(mbeanName, 
"Name").toString();
         garbageCollector = GarbageCollector.fromName(name);
     }
 
@@ -75,7 +73,7 @@ public class GarbageCollectorModel implements 
MBeanCacheListener {
     }
 
     public String getName() {
-        return name;
+        return garbageCollector.getName();
     }
 
     public long getCount() {
diff --git a/src/com/kodewerk/visualvm/memorypools/PanelPositions.java 
b/src/com/kodewerk/visualvm/memorypools/PanelPositions.java
index 4b3eb4c..aefb962 100644
--- a/src/com/kodewerk/visualvm/memorypools/PanelPositions.java
+++ b/src/com/kodewerk/visualvm/memorypools/PanelPositions.java
@@ -1,5 +1,6 @@
 package com.kodewerk.visualvm.memorypools;
 
+import com.kodewerk.visualvm.memorypools.gc.GarbageCollector;
 import com.sun.tools.visualvm.core.ui.components.DataViewComponent;
 
 import java.awt.*;
@@ -42,8 +43,14 @@ public class PanelPositions {
 
         // Hotspot Garbage Collectors
         positions.put("GC Summary Panel", new 
Point(DataViewComponent.BOTTOM_RIGHT, 20));
-        positions.put("PS Scavenge", new 
Point(DataViewComponent.BOTTOM_RIGHT, 20));
-        positions.put("PS MarkSweep", new 
Point(DataViewComponent.BOTTOM_RIGHT, 20));
+        positions.put(GarbageCollector.PS_SCAVENGE.getName(), new 
Point(DataViewComponent.BOTTOM_RIGHT, 20));
+        positions.put(GarbageCollector.PS_MARK_SWEEP.getName(), new 
Point(DataViewComponent.BOTTOM_RIGHT, 20));
+        positions.put(GarbageCollector.SERIAL.getName(), new 
Point(DataViewComponent.BOTTOM_RIGHT, 20));
+        positions.put(GarbageCollector.MARK_SWEEP_COMPACT.getName(), new 
Point(DataViewComponent.BOTTOM_RIGHT, 20));
+        positions.put(GarbageCollector.PAR_NEW.getName(), new 
Point(DataViewComponent.BOTTOM_RIGHT, 20));
+        positions.put(GarbageCollector.CMS.getName(), new 
Point(DataViewComponent.BOTTOM_RIGHT, 20));
+        positions.put(GarbageCollector.G1_YOUNG.getName(), new 
Point(DataViewComponent.BOTTOM_RIGHT, 20));
+        positions.put(GarbageCollector.G1_OLD.getName(), new 
Point(DataViewComponent.BOTTOM_RIGHT, 20));
 
     }
 
diff --git a/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollector.java 
b/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollector.java
index b9d36e9..555abe1 100644
--- a/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollector.java
+++ b/src/com/kodewerk/visualvm/memorypools/gc/GarbageCollector.java
@@ -2,7 +2,13 @@ package com.kodewerk.visualvm.memorypools.gc;
 
 public enum GarbageCollector {
     PS_SCAVENGE("PS Scavenge", Generation.YOUNG)
+    , PAR_NEW("ParNew", Generation.YOUNG)
+    , SERIAL("Copy", Generation.YOUNG)
+    , G1_YOUNG("G1 Young Generation", Generation.YOUNG)
     , PS_MARK_SWEEP("PS MarkSweep", Generation.OLD)
+    , MARK_SWEEP_COMPACT("MarkSweepCompact", Generation.OLD)
+    , CMS("ConcurrentMarkSweep", Generation.OLD)
+    , G1_OLD("G1 Old Generation", Generation.OLD)
     ;
 
     private final String name;




[memorypoolview~source-code-repository:68c0faf3] Added Hotspot garbage collectors

pingtimeout 03/12/2013
 
 
Close
loading
Please Confirm
Close