[ 
https://issues.apache.org/jira/browse/NETBEANS-1836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16908437#comment-16908437
 ] 

Jan Lahoda commented on NETBEANS-1836:
--------------------------------------

I wonder what is the reason for running out of memory. The "remSel" list only 
keeps paths that are in the selection model, so adding them into the list 
shouldn't be too memory intensive (for ~10,000 nodes). So I wonder what runs 
out of memory? Thanks!

> Out of heap space removing large number of nodes
> ------------------------------------------------
>
>                 Key: NETBEANS-1836
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-1836
>             Project: NetBeans
>          Issue Type: Bug
>          Components: platform - Explorer
>    Affects Versions: 8.2
>            Reporter: Rangi Keen
>            Priority: Critical
>              Labels: pull-request-available
>         Attachments: RemoveNodeOutOfHeapSpace.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> 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|https://netbeans.org/bugzilla/show_bug.cgi?id=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 (in [^RemoveNodeOutOfHeapSpace.patch]) 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|https://bugs.openjdk.java.net/browse/JDK-6472844]), so I think 
> this will maintain the intent and not result in further memory leaks.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to