Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-1836

Out of heap space removing large number of nodes

    XMLWordPrintableJSON

Details

    Description

      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 (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), so I think this will maintain the intent and not result in further memory leaks.

      Attachments

        1. RemoveNodeOutOfHeapSpace.patch
          0.8 kB
          Rangi Keen

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rkeen Rangi Keen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h