changeset 36:148d3cf69970

Rehash timeline colors
author shade
date Tue, 19 Sep 2017 21:21:01 +0200
parents 127e091e09bd
children 3de9120aa9ea
files src/main/java/org/openjdk/shenandoah/Colors.java src/main/java/org/openjdk/shenandoah/ShenandoahVisualizer.java src/main/java/org/openjdk/shenandoah/Snapshot.java src/main/java/org/openjdk/shenandoah/SnapshotView.java
diffstat 4 files changed, 19 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/org/openjdk/shenandoah/Colors.java	Tue Sep 19 16:37:14 2017 +0200
+++ b/src/main/java/org/openjdk/shenandoah/Colors.java	Tue Sep 19 21:21:01 2017 +0200
@@ -18,6 +18,7 @@
 
     static final Color USED                 = new Color(220, 220, 220);
 
+    static final Color LIVE_COMMITTED       = new Color(150, 150, 150);
     static final Color LIVE_REGULAR         = new Color(0, 200, 0);
     static final Color LIVE_HUMONGOUS       = new Color(250, 100, 0);
     static final Color LIVE_CSET            = new Color(250, 250, 0);
--- a/src/main/java/org/openjdk/shenandoah/ShenandoahVisualizer.java	Tue Sep 19 16:37:14 2017 +0200
+++ b/src/main/java/org/openjdk/shenandoah/ShenandoahVisualizer.java	Tue Sep 19 21:21:01 2017 +0200
@@ -220,20 +220,18 @@
                 }
                 g.drawRect(x, 0, 1, graphHeight);
 
+                g.setColor(Colors.LIVE_COMMITTED);
+                g.drawRect(x, (int) Math.round(graphHeight - s.committed() * stepY), 1, 1);
                 g.setColor(Colors.USED);
                 g.drawRect(x, (int) Math.round(graphHeight - s.used() * stepY), 1, 1);
-                g.setColor(Colors.SHARED_ALLOC);
-                g.drawRect(x, (int) Math.round(graphHeight - s.sharedAllocs() * stepY), 1, 1);
-                g.setColor(Colors.TLAB_ALLOC);
-                g.drawRect(x, (int) Math.round(graphHeight - s.tlabAllocs() * stepY), 1, 1);
-                g.setColor(Colors.GCLAB_ALLOC);
-                g.drawRect(x, (int) Math.round(graphHeight - s.gclabAllocs() * stepY), 1, 1);
                 g.setColor(Colors.LIVE_HUMONGOUS);
                 g.drawRect(x, (int) Math.round(graphHeight - s.humongous() * stepY), 1, 1);
                 g.setColor(Colors.LIVE_REGULAR);
                 g.drawRect(x, (int) Math.round(graphHeight - s.live() * stepY), 1, 1);
                 g.setColor(Colors.LIVE_CSET);
                 g.drawRect(x, (int) Math.round(graphHeight - s.collectionSet() * stepY), 1, 1);
+                g.setColor(Colors.LIVE_TRASH);
+                g.drawRect(x, (int) Math.round(graphHeight - s.trash() * stepY), 1, 1);
             }
         }
 
--- a/src/main/java/org/openjdk/shenandoah/Snapshot.java	Tue Sep 19 16:37:14 2017 +0200
+++ b/src/main/java/org/openjdk/shenandoah/Snapshot.java	Tue Sep 19 21:21:01 2017 +0200
@@ -81,26 +81,18 @@
         return used;
     }
 
-    public long tlabAllocs() {
+    public long committed() {
         long r = 0L;
         for (RegionStat rs : stats) {
-            r += regionSize * rs.tlabAllocs();
+            r += (rs.state() == RegionState.EMPTY_UNCOMMITTED) ? 0 : regionSize * rs.used();
         }
         return r;
     }
 
-    public long gclabAllocs() {
+    public long trash() {
         long r = 0L;
         for (RegionStat rs : stats) {
-            r += regionSize * rs.gclabAllocs();
-        }
-        return r;
-    }
-
-    public long sharedAllocs() {
-        long r = 0L;
-        for (RegionStat rs : stats) {
-            r += regionSize * rs.sharedAllocs();
+            r += (rs.state() == RegionState.TRASH) ? rs.used() : 0;
         }
         return r;
     }
--- a/src/main/java/org/openjdk/shenandoah/SnapshotView.java	Tue Sep 19 16:37:14 2017 +0200
+++ b/src/main/java/org/openjdk/shenandoah/SnapshotView.java	Tue Sep 19 21:21:01 2017 +0200
@@ -5,25 +5,23 @@
     private final long time;
     private final Phase phase;
     private final long total;
+    private final long committed;
     private final long used;
     private final long live;
-    private final long tlabAllocs;
-    private final long gclabAllocs;
-    private final long sharedAllocs;
     private final long humongous;
     private final long collectionSet;
+    private final long trash;
 
     public SnapshotView(Snapshot s) {
         time = s.time();
         phase = s.phase();
         total = total();
+        committed = s.committed();
         used = s.used();
         live = s.live();
-        sharedAllocs = s.sharedAllocs();
-        tlabAllocs = s.tlabAllocs();
-        gclabAllocs = s.gclabAllocs();
         humongous = s.humongous();
         collectionSet = s.collectionSet();
+        trash = s.trash();
     }
 
     public Phase phase() {
@@ -42,20 +40,16 @@
         return used;
     }
 
-    public long sharedAllocs() {
-        return sharedAllocs;
+    public long collectionSet() {
+        return collectionSet;
     }
 
-    public long tlabAllocs() {
-        return tlabAllocs;
+    public long trash() {
+        return trash;
     }
 
-    public long gclabAllocs() {
-        return gclabAllocs;
-    }
-
-    public long collectionSet() {
-        return collectionSet;
+    public long committed() {
+        return committed;
     }
 
     public long humongous() {