Skip to content
Permalink
Browse files
6766: Add heap usage before and after GC to the Garbage Collections t…
…able

Reviewed-by: hirt
  • Loading branch information
jpbempel authored and thegreystone committed Oct 2, 2020
1 parent a63a706 commit 97f4d9ff4d0af2379445c2762175119f99c6b73b
@@ -199,6 +199,8 @@
public static String GarbageCollectionsPage_ROW_PAUSE_PHASES;
public static String GarbageCollectionsPage_ROW_PAUSE_PHASES_DESC;
public static String GarbageCollectionsPage_TIMELINE_SELECTION;
public static String GarbageCollectionsPage_USED_HEAP_AFTER_GC;
public static String GarbageCollectionsPage_USED_HEAP_BEFORE_GC;
public static String GarbageCollectionsPage_USED_HEAP_DELTA;
public static String GarbageCollectionsPage_USED_METASPACE_DELTA;
public static String HeapPage_LIVE_SIZE_OF_CLASS;
@@ -198,6 +198,8 @@ public IDisplayablePage createPage(IPageDefinition dpd, StreamModel items, IPage
IQuantity sumOfPauses;
IQuantity startTime;
IQuantity endTime;
IQuantity usedBeforeGC;
IQuantity usedAfterGC;
IQuantity usedDelta;
IQuantity committedDelta;
IQuantity usedMetaspaceDelta;
@@ -207,6 +209,8 @@ public IDisplayablePage createPage(IPageDefinition dpd, StreamModel items, IPage
this.type = type;
this.gcItem = gcItem;
referenceStatisticsData = new Object[REF_TYPE.length];
usedBeforeGC = UnitLookup.BYTE.quantity(0);
usedAfterGC = UnitLookup.BYTE.quantity(0);
usedDelta = UnitLookup.BYTE.quantity(0);
committedDelta = UnitLookup.BYTE.quantity(0);
usedMetaspaceDelta = UnitLookup.BYTE.quantity(0);
@@ -315,6 +319,10 @@ void setRefCount(Object type, Object count) {
columns.add(new ColumnBuilder(t.localizedName, "ReferenceStatisticsType-" + t.name(), //$NON-NLS-1$
o -> ((GC) o).getRefCount(t)).style(SWT.RIGHT).build());
}
columns.add(new ColumnBuilder(Messages.GarbageCollectionsPage_USED_HEAP_BEFORE_GC, "usedHeapBegoreGC", //$NON-NLS-1$
o -> ((GC) o).usedBeforeGC).style(SWT.RIGHT).build());
columns.add(new ColumnBuilder(Messages.GarbageCollectionsPage_USED_HEAP_AFTER_GC, "usedHeapAfterGC", //$NON-NLS-1$
o -> ((GC) o).usedAfterGC).style(SWT.RIGHT).build());
columns.add(new ColumnBuilder(Messages.GarbageCollectionsPage_USED_HEAP_DELTA, "usedHeapDelta", //$NON-NLS-1$
o -> ((GC) o).usedDelta).style(SWT.RIGHT).build());
columns.add(new ColumnBuilder(Messages.GarbageCollectionsPage_COMMITTED_HEAP_DELTA, "committedHeapDelta", //$NON-NLS-1$
@@ -654,10 +662,12 @@ private void updateTable(IItemCollection gcs) {
if (gc != null) {
String when = gcWhenAccessor.getMember(item);
if ("Before GC".equals(when)) { //$NON-NLS-1$
gc.usedDelta = gc.usedDelta.subtract(usedHeapAccessor.getMember(item));
gc.usedBeforeGC = usedHeapAccessor.getMember(item);
gc.usedDelta = gc.usedDelta.subtract(gc.usedBeforeGC);
gc.committedDelta = gc.committedDelta.subtract(committedHeapAccessor.getMember(item));
} else {
gc.usedDelta = gc.usedDelta.add(usedHeapAccessor.getMember(item));
gc.usedAfterGC = usedHeapAccessor.getMember(item);
gc.usedDelta = gc.usedDelta.add(gc.usedAfterGC);
gc.committedDelta = gc.committedDelta.add(committedHeapAccessor.getMember(item));
}
}
@@ -295,6 +295,8 @@ GarbageCollectionsPage_ROW_METASPACE_DESC=This lane can show various metaspace r
GarbageCollectionsPage_ROW_PAUSE_PHASES=Pause Phases
GarbageCollectionsPage_ROW_PAUSE_PHASES_DESC=Phases of the garbage collection pauses
GarbageCollectionsPage_TIMELINE_SELECTION=Garbage Collections Timeline Selection
GarbageCollectionsPage_USED_HEAP_AFTER_GC=Used Heap After GC
GarbageCollectionsPage_USED_HEAP_BEFORE_GC=Used Heap Before GC
GarbageCollectionsPage_USED_HEAP_DELTA=Used Heap Delta
GarbageCollectionsPage_USED_METASPACE_DELTA=Used Metaspace Delta
GCConfigurationPage_PAGE_NAME=GC Configuration

0 comments on commit 97f4d9f

Please sign in to comment.