This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258435 - Out of heap space removing large number of nodes
Summary: Out of heap space removing large number of nodes
Status: RESOLVED INCOMPLETE
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 8.0.2
Hardware: All Linux
: P2 normal (vote)
Assignee: Jan Peska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-18 15:54 UTC by rkeen
Modified: 2018-12-26 22:32 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Possible fix (814 bytes, patch)
2016-03-18 15:54 UTC, rkeen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description rkeen 2016-03-18 15:54:03 UTC
Created attachment 158919 [details]
Possible fix

If you remove a large number of selected nodes (e.g. 10,000), you may run out of heap space. Note that this does not occur when deleting nodes because the nodes are first deselected, but it will happen if the nodes to be removed are not first deselected.

This seems to be related to bug #193852 designed to attempt to maintain cursor position when removing a node from the tree. Prior to the change for this bug, the node parent was set to null when the node was destroyed and therefore was not added to the list of nodes to be deselected in org.openide.explorer.view.TreeView.removedNodes.

One fix (patch attached) is to change the check in org.openide.explorer.view.TreeView.removedNodes when adding to the removed selection list (remSel) to avoid adding paths for the nodes that will be deleted and only add the selected child nodes. This was put in place to avoid leaking memory for child nodes (see JDK-6472844), so I think this will maintain the intent and not result in further memory leaks.
Comment 1 rkeen 2018-12-26 22:32:45 UTC
Moved to the Apache issue tracking system: https://issues.apache.org/jira/browse/NETBEANS-1836