diff --git a/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalHeapRenderer.java b/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalHeapRenderer.java index 5e6d7d6f..c5ed3e9f 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalHeapRenderer.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalHeapRenderer.java @@ -38,7 +38,13 @@ public Polygon computePolygon(ModelChart modelChart, GCModel model) { if (event.getTotal() > 0) { // there are events that don't have a heap size associated (like "GC remark" of G1) // -> skip them - polygon.addPoint(event.getTimestamp() - model.getFirstPauseTimeStamp(), event.getTotal()); + if (polygon.npoints == 1) { + // first point needs to be treated different from the rest, + // because otherwise the polygon would not start with a vertical line at 0, + // but with a slanting line between 0 and after the first pause + polygon.addPoint(0, (double)event.getTotal()); + } + polygon.addPoint(event.getTimestamp() - model.getFirstPauseTimeStamp() + event.getPause(), event.getTotal()); lastTotal = event.getTotal(); } } diff --git a/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalTenuredRenderer.java b/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalTenuredRenderer.java index 8e9e7509..4ec58f95 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalTenuredRenderer.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalTenuredRenderer.java @@ -35,27 +35,22 @@ public TotalTenuredRenderer(ModelChartImpl modelChart) { public Polygon computePolygon(ModelChart modelChart, GCModel model) { ScaledPolygon polygon = createMemoryScaledPolygon(); polygon.addPoint(0.0d, 0.0d); - double lastTotal = 0.0d; + double lastTotal = 0; for (Iterator> i = model.getStopTheWorldEvents(); i.hasNext();) { AbstractGCEvent abstractGCEvent = i.next(); if (abstractGCEvent instanceof GCEvent) { GCEvent event = (GCEvent) abstractGCEvent; GCEvent tenured = event.getTenured(); if (hasMemoryInformation(event) && tenured != null) { - double total = tenured.getTotal(); if (polygon.npoints == 1) { // first point needs to be treated different from the rest, // because otherwise the polygon would not start with a vertical line at 0, // but with a slanting line between 0 and after the first pause - polygon.addPoint(0.0d, total); - lastTotal = total; + polygon.addPoint(0, (double)tenured.getTotal()); } - - if (lastTotal != total) { - polygon.addPoint(tenured.getTimestamp() - model.getFirstPauseTimeStamp(), lastTotal); - } - polygon.addPoint(tenured.getTimestamp() - model.getFirstPauseTimeStamp() + tenured.getPause(), total); - lastTotal = total; + polygon.addPoint(tenured.getTimestamp() - model.getFirstPauseTimeStamp() + event.getPause(), + tenured.getTotal()); + lastTotal = tenured.getTotal(); } } } diff --git a/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalYoungRenderer.java b/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalYoungRenderer.java index b400315a..811a0f66 100644 --- a/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalYoungRenderer.java +++ b/src/main/java/com/tagtraum/perf/gcviewer/renderer/TotalYoungRenderer.java @@ -56,11 +56,6 @@ public Polygon computePolygon(ModelChart modelChart, GCModel model) { // because otherwise the polygon would not start with a vertical line at 0, // but with a slanting line between 0 and after the first pause polygon.addPoint(0, tenuredSize + youngSize); - lastYoung = youngSize; - lastTenured = tenuredSize; - } - if (((lastTenured + lastYoung) - (tenuredSize + youngSize)) > 0.0000001) { - polygon.addPoint(event.getTimestamp() - model.getFirstPauseTimeStamp(), lastTenured + lastYoung); } polygon.addPoint(event.getTimestamp() - model.getFirstPauseTimeStamp() + event.getPause(), tenuredSize + youngSize); lastYoung = youngSize;