Skip to content

Commit 7f96260

Browse files
committed
Compute Java heap summary in a worker thread
1 parent 7a17c88 commit 7f96260

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

visualvm/heapviewer/src/com/sun/tools/visualvm/heapviewer/java/impl/JavaHeapSummaryView.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ public class JavaHeapSummaryView extends HeapViewerFeature {
8282
private JComponent component;
8383
private ProfilerToolbar toolbar;
8484

85+
private String summaryText;
86+
8587

8688
public JavaHeapSummaryView(HeapContext context) {
8789
super("java_heap_summary", Bundle.JavaHeapSummaryView_Name(), Bundle.JavaHeapSummaryView_Description(),
8890
Icons.getIcon(HeapWalkerIcons.PROPERTIES), 100); // NOI18N
8991
this.context = context;
92+
93+
this.summaryText = createSummary();
9094
}
9195

9296

@@ -110,12 +114,13 @@ private void init() {
110114
toolbar = ProfilerToolbar.create(false);
111115

112116

113-
HTMLTextArea text = new HTMLTextArea();
114-
text.setText(createSummary());
117+
HTMLTextArea text = new HTMLTextArea(summaryText);
115118
text.setCaretPosition(0);
116119
text.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
117120

118121
component = new ScrollableContainer(text);
122+
123+
summaryText = null;
119124
}
120125

121126

0 commit comments

Comments
 (0)