Skip to content

Commit c4194f5

Browse files
committed
GH-596 do not expand all threads
1 parent 3aa8520 commit c4194f5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

visualvm/heapviewer/src/org/graalvm/visualvm/heapviewer/java/impl/JavaThreadsView.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import java.awt.event.ActionEvent;
3030
import java.awt.event.ItemEvent;
3131
import java.net.URL;
32+
import java.util.Arrays;
3233
import java.util.Collection;
3334
import java.util.List;
3435
import javax.swing.AbstractAction;
@@ -196,9 +197,14 @@ public void run() {
196197
}
197198
}
198199

200+
private static final int MAX_EXPAND_SIZE = 1000;
201+
private static final int DEFAULT_EXPAND_SIZE = 800;
199202

200203
private void setupDefault() {
201204
CCTNode[] children = objectsView.getRoot().getChildren();
205+
if (children.length > MAX_EXPAND_SIZE) {
206+
children = Arrays.copyOf(children, DEFAULT_EXPAND_SIZE);
207+
}
202208
for (CCTNode child : children) objectsView.expandNode((HeapViewerNode)child);
203209
}
204210

0 commit comments

Comments
 (0)