Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public static Color getColor(String typeId) {
return new Color(0x000096);
case JdkTypeIDs.THREAD_DUMP:
return new Color(0xFFA800);
case JdkTypeIDs.TENURING_DISTRIBUTION:
return new Color(0x4682B4);
default:
// "http://www.oracle.com/hotspot/jvm/vm/gc/collector/old_garbage_collection" -> new Color(0x800000);
// "http://www.oracle.com/hotspot/jvm/vm/gc/collector/young_garbage_collection" -> new Color(0xFF8080);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@ public class Messages extends NLS {
public static String GarbageCollectionsPage_PAGE_NAME;
public static String GarbageCollectionsPage_PAUSE_PHASES_TITLE;
public static String GarbageCollectionsPage_PAUSE_PHASE_SELECTION;
public static String GarbageCollectionsPage_TENURING_DISTRIBUTION_TITLE;
public static String GarbageCollectionsPage_TENURING_DISTRIBUTION_NO_SELECTION_MESSAGE;
public static String GarbageCollectionsPage_TENURING_DISTRIBUTION_MULTI_SELECTION_MESSAGE;
public static String GarbageCollectionsPage_TENURING_SIZE;
public static String GarbageCollectionsPage_ROW_HEAP;
public static String GarbageCollectionsPage_ROW_HEAP_DESC;
public static String GarbageCollectionsPage_ROW_HEAP_POST_GC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.FormToolkit;

Expand All @@ -92,6 +94,7 @@
import org.openjdk.jmc.common.unit.LinearKindOfQuantity;
import org.openjdk.jmc.common.unit.UnitLookup;
import org.openjdk.jmc.flightrecorder.JfrAttributes;
import org.openjdk.jmc.flightrecorder.jdk.JdkAggregators;
import org.openjdk.jmc.flightrecorder.jdk.JdkAttributes;
import org.openjdk.jmc.flightrecorder.jdk.JdkFilters;
import org.openjdk.jmc.flightrecorder.jdk.JdkTypeIDs;
Expand All @@ -106,6 +109,7 @@
import org.openjdk.jmc.flightrecorder.ui.IPageUI;
import org.openjdk.jmc.flightrecorder.ui.StreamModel;
import org.openjdk.jmc.flightrecorder.ui.common.AbstractDataPage;
import org.openjdk.jmc.flightrecorder.ui.common.BucketBuilder;
import org.openjdk.jmc.flightrecorder.ui.common.DataPageToolkit;
import org.openjdk.jmc.flightrecorder.ui.common.FilterComponent;
import org.openjdk.jmc.flightrecorder.ui.common.FlavorSelector;
Expand All @@ -119,12 +123,14 @@
import org.openjdk.jmc.flightrecorder.ui.messages.internal.Messages;
import org.openjdk.jmc.flightrecorder.ui.selection.SelectionStoreActionToolkit;
import org.openjdk.jmc.ui.charts.AWTChartToolkit;
import org.openjdk.jmc.ui.charts.IQuantitySeries;
import org.openjdk.jmc.ui.charts.ISpanSeries;
import org.openjdk.jmc.ui.charts.IXDataRenderer;
import org.openjdk.jmc.ui.charts.QuantitySeries;
import org.openjdk.jmc.ui.charts.RendererToolkit;
import org.openjdk.jmc.ui.charts.SpanRenderer;
import org.openjdk.jmc.ui.charts.XYChart;
import org.openjdk.jmc.ui.charts.XYDataRenderer;
import org.openjdk.jmc.ui.column.ColumnBuilder;
import org.openjdk.jmc.ui.column.ColumnManager;
import org.openjdk.jmc.ui.column.ColumnManager.SelectionState;
Expand Down Expand Up @@ -177,6 +183,9 @@ public IDisplayablePage createPage(IPageDefinition dpd, StreamModel items, IPage
private final static Color LONGEST_PAUSE_COLOR = DataPageToolkit.GC_BASE_COLOR.brighter();
private final static Color SUM_OF_PAUSES_COLOR = DataPageToolkit.GC_BASE_COLOR.brighter().brighter();

private static final Color TENURING_DISTRIBUTION_EVENT_COLOR = TypeLabelProvider
.getColorOrDefault(JdkTypeIDs.TENURING_DISTRIBUTION);

public static final IAttribute<IQuantity> HEAP_USED_POST_GC = attr("heapUsed", Messages.ATTR_HEAP_USED_POST_GC, //$NON-NLS-1$
Messages.ATTR_HEAP_USED_POST_GC_DESC, MEMORY);

Expand All @@ -187,6 +196,8 @@ public IDisplayablePage createPage(IPageDefinition dpd, StreamModel items, IPage
JdkAttributes.GC_METASPACE_COMMITTED, JdkAttributes.GC_METASPACE_RESERVED)
.build();

private static final IAggregator<IQuantity, ?> tenuringAgeSizeAggregator = JdkAggregators.TENURING_AGE_SIZE;

private static class GC {
final IType<IItem> type;
final IItem gcItem;
Expand Down Expand Up @@ -288,6 +299,12 @@ private class GarbageCollectionsUi implements IPageUI {
private FilterComponent phasesFilter;
private ItemList metaspaceList;
private FilterComponent metaspaceFilter;
private Composite tenuringComposite;
private StackLayout tenuringLayout;
private ChartCanvas tenuringChartCanvas;
private XYChart tenuringChart;
private Label noGcIdSelectionLabel;
private Label multiGcIdSelectionLabel;
private CTabFolder gcInfoFolder;
private IItemCollection selectionItems;
private FlavorSelector flavorSelector;
Expand Down Expand Up @@ -341,6 +358,7 @@ private class GarbageCollectionsUi implements IPageUI {
pageContainer.showSelection(ItemCollectionToolkit.build(gcSelectedGcItems()));
updatePhaseList();
updateMetaspaceList();
updateTenuringHistogram();
});

SelectionStoreActionToolkit.addSelectionStoreActions(gcList.getViewer(), pageContainer.getSelectionStore(),
Expand Down Expand Up @@ -388,6 +406,24 @@ private class GarbageCollectionsUi implements IPageUI {
DataPageToolkit.addTabItem(gcInfoFolder, metaspaceFilter.getComponent(),
Messages.GarbageCollectionsPage_METASPACE_TITLE);

tenuringComposite = toolkit.createComposite(gcInfoFolder);
tenuringLayout = new StackLayout();
tenuringComposite.setLayout(tenuringLayout);
noGcIdSelectionLabel = new Label(tenuringComposite, SWT.CENTER);
noGcIdSelectionLabel.setText(Messages.GarbageCollectionsPage_TENURING_DISTRIBUTION_NO_SELECTION_MESSAGE);
multiGcIdSelectionLabel = new Label(tenuringComposite, SWT.CENTER);
multiGcIdSelectionLabel
.setText(Messages.GarbageCollectionsPage_TENURING_DISTRIBUTION_MULTI_SELECTION_MESSAGE);
tenuringChart = new XYChart(UnitLookup.NUMBER.getDefaultUnit().quantity(0),
UnitLookup.NUMBER.getDefaultUnit().quantity(16), RendererToolkit.empty(), 95);
tenuringChartCanvas = new ChartCanvas(tenuringComposite);
tenuringChartCanvas.setChart(tenuringChart);
DataPageToolkit.createChartTooltip(tenuringChartCanvas);
tenuringLayout.topControl = noGcIdSelectionLabel;
tenuringComposite.layout();
DataPageToolkit.addTabItem(gcInfoFolder, tenuringComposite,
Messages.GarbageCollectionsPage_TENURING_DISTRIBUTION_TITLE);

Composite chartContainer = toolkit.createComposite(sash);
chartContainer.setLayout(new GridLayout(2, false));
chartCanvas = new ChartCanvas(chartContainer);
Expand Down Expand Up @@ -452,6 +488,30 @@ private void updateMetaspaceList() {
metaspaceList.show(ItemCollectionToolkit.filterIfNotNull(getMetaspaceItems(), metaspaceFilterState));
}

private void updateTenuringHistogram() {
Set<IQuantity> selectedGcIds = getSelectedGcIds();
if (selectedGcIds.isEmpty()) {
tenuringLayout.topControl = noGcIdSelectionLabel;
} else if (selectedGcIds.size() > 1) {
tenuringLayout.topControl = multiGcIdSelectionLabel;
} else {
IQuantity selectedGcId = selectedGcIds.iterator().next();
IItemCollection items = getDataSource().getItems()
.apply(ItemFilters.type(JdkTypeIDs.TENURING_DISTRIBUTION))
.apply(ItemFilters.equals(JdkAttributes.GC_ID, selectedGcId));
IQuantitySeries<IQuantity[]> series = BucketBuilder.aggregatorSeries(items, tenuringAgeSizeAggregator,
JdkAttributes.TENURING_DISTRIBUTION_AGE);
XYDataRenderer renderer = new XYDataRenderer(UnitLookup.MEMORY.getDefaultUnit().quantity(0),
tenuringAgeSizeAggregator.getName(), tenuringAgeSizeAggregator.getDescription());
renderer.addBarChart(tenuringAgeSizeAggregator.getName(), series, TENURING_DISTRIBUTION_EVENT_COLOR);
IXDataRenderer itemRow = new ItemRow(Messages.GarbageCollectionsPage_TENURING_SIZE,
tenuringAgeSizeAggregator.getDescription(), renderer, items);
tenuringChartCanvas.replaceRenderer(itemRow);
tenuringLayout.topControl = tenuringChartCanvas;
}
tenuringComposite.layout();
}

private IItemCollection getMetaspaceItems() {
Set<IQuantity> selectedGcIds = getSelectedGcIds();
IItemCollection metaspaceItems = getDataSource().getItems().apply(JdkFilters.METASPACE_SUMMARY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ GarbageCollectionsPage_METASPACE_TITLE=Metaspace
GarbageCollectionsPage_PAGE_NAME=Garbage Collections
GarbageCollectionsPage_PAUSE_PHASE_SELECTION=GC Pause Phase Selection
GarbageCollectionsPage_PAUSE_PHASES_TITLE=Pause Phases
GarbageCollectionsPage_TENURING_DISTRIBUTION_TITLE=Tenuring Distribution
GarbageCollectionsPage_TENURING_DISTRIBUTION_NO_SELECTION_MESSAGE=No valid Selection
GarbageCollectionsPage_TENURING_DISTRIBUTION_MULTI_SELECTION_MESSAGE=Distribution is shown for a single GC cycle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this can be more specific? "Multiple GC cycles selected. Distribution is only shown for a single GC."

GarbageCollectionsPage_TENURING_SIZE=Size
GarbageCollectionsPage_ROW_HEAP=Heap
GarbageCollectionsPage_ROW_HEAP_DESC=This lane can show various Java heap related graphs. Use the legend entries to select the ones to show.
GarbageCollectionsPage_ROW_HEAP_POST_GC= Heap Post GC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,11 @@ public final class JdkAggregators {
public static final IAggregator<?, ?> TOP_ADDRESS = Aggregators.min(JdkTypeIDs.NATIVE_LIBRARY,
JdkAttributes.TOP_ADDRESS);

public static final IAggregator<IQuantity, ?> TENURING_AGE_SIZE = Aggregators.sum(
Messages.getString(Messages.AGGR_TENURING_AGE_SIZE),
Messages.getString(Messages.AGGR_TENURING_AGE_SIZE_DESC), JdkTypeIDs.TENURING_DISTRIBUTION,
JdkAttributes.TENURING_DISTRIBUTION_SIZE);

/**
* Aggregator for getting the first value, ie. the value from the event with the first occurring
* start time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,12 @@ public String getMember(U i) {
public static final IAttribute<IQuantity> TENURING_THRESHOLD_MAXIMUM = attr("maxTenuringThreshold", //$NON-NLS-1$
Messages.getString(Messages.ATTR_TENURING_THRESHOLD_MAXIMUM),
Messages.getString(Messages.ATTR_TENURING_THRESHOLD_MAXIMUM_DESC), NUMBER);
public static final IAttribute<IQuantity> TENURING_DISTRIBUTION_SIZE = attr("size", //$NON-NLS-1$
Messages.getString(Messages.ATTR_TENURING_DISTRIBUTION_SIZE),
Messages.getString(Messages.ATTR_TENURING_DISTRIBUTION_SIZE_DESC), MEMORY);
public static final IAttribute<IQuantity> TENURING_DISTRIBUTION_AGE = attr("age", //$NON-NLS-1$
Messages.getString(Messages.ATTR_TENURING_DISTRIBUTION_AGE),
Messages.getString(Messages.ATTR_TENURING_DISTRIBUTION_AGE_DESC), NUMBER);
public static final IAttribute<Boolean> USES_TLABS = attr("usesTLABs", Messages.getString(Messages.ATTR_USES_TLABS), //$NON-NLS-1$
Messages.getString(Messages.ATTR_USES_TLABS_DESC), FLAG);
public static final IAttribute<IQuantity> TLAB_MIN_SIZE = attr("minTLABSize", //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ public final class JdkTypeIDs {
public static final String BIASED_LOCK_REVOCATION = PREFIX + "BiasedLockRevocation";
public static final String BIASED_LOCK_CLASS_REVOCATION = PREFIX + "BiasedLockClassRevocation";
public static final String GC_G1_ADAPTIVE_IHOP = PREFIX + "G1AdaptiveIHOP";
public static final String TENURING_DISTRIBUTION = PREFIX + "TenuringDistribution";

public static final String RECORDINGS = PREFIX + "ActiveRecording";
public static final String RECORDING_SETTING = PREFIX + "ActiveSetting";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ public class Messages {
public static final String AGGR_ALL_COLLECTION_GC_COUNT_DESC = "AGGR_ALL_COLLECTION_GC_COUNT_DESC"; //$NON-NLS-1$
public static final String AGGR_ZGC_ALLOCATION_STALL_COUNT = "AGGR_ZGC_ALLOCATION_STALL_COUNT"; //$NON-NLS-1$
public static final String AGGR_ZGC_ALLOCATION_STALL_COUNT_DESC = "AGGR_ZGC_ALLOCATION_STALL_COUNT_DESC"; //$NON-NLS-1$
public static final String AGGR_TENURING_AGE_SIZE = "AGGR_TENURING_AGE_SIZE"; //$NON-NLS-1$
public static final String AGGR_TENURING_AGE_SIZE_DESC = "AGGR_TENURING_AGE_SIZE_DESC"; //$NON-NLS-1$
public static final String AGGR_MAX_BLOCKED_TIME = "AGGR_MAX_BLOCKED_TIME"; //$NON-NLS-1$
public static final String AGGR_MAX_BLOCKED_TIME_DESC = "AGGR_MAX_BLOCKED_TIME_DESC"; //$NON-NLS-1$
public static final String AGGR_MAX_IO_TIME = "AGGR_MAX_IO_TIME"; //$NON-NLS-1$
Expand Down Expand Up @@ -532,6 +534,10 @@ public class Messages {
public static final String ATTR_TENURING_THRESHOLD_INITIAL_DESC = "ATTR_TENURING_THRESHOLD_INITIAL_DESC"; //$NON-NLS-1$
public static final String ATTR_TENURING_THRESHOLD_MAXIMUM = "ATTR_TENURING_THRESHOLD_MAXIMUM"; //$NON-NLS-1$
public static final String ATTR_TENURING_THRESHOLD_MAXIMUM_DESC = "ATTR_TENURING_THRESHOLD_MAXIMUM_DESC"; //$NON-NLS-1$
public static final String ATTR_TENURING_DISTRIBUTION_SIZE = "ATTR_TENURING_DISTRIBUTION_SIZE"; //$NON-NLS-1$
public static final String ATTR_TENURING_DISTRIBUTION_SIZE_DESC = "ATTR_TENURING_DISTRIBUTION_SIZE_DESC"; //$NON-NLS-1$
public static final String ATTR_TENURING_DISTRIBUTION_AGE = "ATTR_TENURING_DISTRIBUTION_AGE"; //$NON-NLS-1$
public static final String ATTR_TENURING_DISTRIBUTION_AGE_DESC = "ATTR_TENURING_DISTRIBUTION_AGE_DESC"; //$NON-NLS-1$
public static final String ATTR_THREAD_DUMP_RESULT = "ATTR_THREAD_DUMP_RESULT"; //$NON-NLS-1$
public static final String ATTR_TLAB_MIN_SIZE = "ATTR_TLAB_MIN_SIZE"; //$NON-NLS-1$
public static final String ATTR_TLAB_MAX_SIZE = "ATTR_TLAB_MAX_SIZE"; //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ ATTR_TENURING_THRESHOLD_INITIAL=Initial Tenuring Threshold
ATTR_TENURING_THRESHOLD_INITIAL_DESC=Initial age limit for how old objects to keep in survivor area
ATTR_TENURING_THRESHOLD_MAXIMUM=Maximum Tenuring Threshold
ATTR_TENURING_THRESHOLD_MAXIMUM_DESC=Upper limit for the age of how old objects to keep in the survivor area
ATTR_TENURING_DISTRIBUTION_SIZE=Tenuring Distribution Size
ATTR_TENURING_DISTRIBUTION_SIZE_DESC=Total size of objects of the corresponding age in the young generation.
ATTR_TENURING_DISTRIBUTION_AGE=Tenuring Distribution Age
ATTR_TENURING_DISTRIBUTION_AGE_DESC=Age of objects in the young generation.
ATTR_USES_TLABS=TLABs Used
ATTR_USES_TLABS_DESC=If Thread Local Allocation Buffers (TLABs) are in use
ATTR_TLAB_MIN_SIZE=Minimum TLAB Size
Expand Down Expand Up @@ -470,6 +474,8 @@ AGGR_ALL_COLLECTION_GC_COUNT=GC Count
AGGR_ALL_COLLECTION_GC_COUNT_DESC=The count of GC for all garbage collection.
AGGR_ZGC_ALLOCATION_STALL_COUNT=ZGC Allocation Stall Count
AGGR_ZGC_ALLOCATION_STALL_COUNT_DESC=The number of ZGC allocation stalls.
AGGR_TENURING_AGE_SIZE=Tenuring Age Size
AGGR_TENURING_AGE_SIZE_DESC=The total size of surviving objects by age in the young garbage collection.
AGGR_JFR_DATA_LOST_COUNT=Buffers of Flight Recorder Data Lost
AGGR_JFR_DATA_LOST_COUNT_DESC=The amount of buffers with flight recorder data that was lost because it could not be written to disk fast enough
AGGR_FLR_DATA_LOST_SIZE=Total Flight Recorder Data Lost
Expand Down