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 270766 - Nodes can not be garbage collected
Summary: Nodes can not be garbage collected
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Nodes (show other bugs)
Version: 8.2
Hardware: PC Other
: P3 normal (vote)
Assignee: Jan Peska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-30 09:27 UTC by splichal
Modified: 2017-05-30 09:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description splichal 2017-05-30 09:27:29 UTC
I have the following scenario:
1) There is a singleton object O which holds its lookup, which is an instance of AbstractLookup.
2) There is a view which displays tree based on Nodes derived from AbstractNode class. This view contains a node like:
   node = new AbstractNode(Children.LEAF, O.getLookup());
3) The view gets recreated from time to time in the way that all nodes including the root are thrown away and new nodes
   are created.
4) The Issue is that the nodes with the lookup of the object O are not garbage collected at all. The problem is probably
   in the class Node, which holds an LookupEventList. This in turn registers itself as a LookupListener to a result
   from the provided Lookup (line 1833). This result accumulates references to the LookupEventLists. And because there
   is always at least one node which uses this result, the result is not freed by the GC and so its listener list
   grows holding more and more LookupEventList. Because the LookupEventLists reference their nodes, the nodes are also
   not freed by GC. 

This may be also to cause of
https://netbeans.org/bugzilla/show_bug.cgi?id=248022