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.
Please take a look at heap dump from: https://netbeans.org/projects/performance/downloads/download/heapdump_java_navigation.hprof.7z It was taken after all projects were closed and one instance of J2SEProject is still held in memory.
Do you see any Java class in the navigator after the project has been closed? If not neither the VisualizerNode nor the ElementNode should exist otherwise fill an issue on navigator.
No class can be seen in navigator, because navigator is closed - the current state of the ide can be seen in heapwalker's preview feature on the IDE's frame. Reassigning to navigator as advised.
Well there is no reference in Navigator framework which prevents GC to collect the project (or at least I can't see any). According to the heapdump there is the node reference kept in FixedHeightLayoutCache used in TreeView. I think the problem could be in CSL/Java navigation or in TreeView itself - reassigning back to the Java/Navigation for further evaluation.
No problem in CSL/Java navigation - the problem is that the TreeView is holding some Node even the TreeView and the enclosing panel was removed by navigator. It's questionable if it was properly removed as the same problem does not happen in other tree view like projects, files, etc.
After the project is closed the BeanTreeView has root context a dummy AbstractNode. The underlaying TreeView$ExplorerTree's selectionModel (DefaultTreeSelectionModel) is OK as it's empty. However DefaultTreeSelectionModel's rowMapper (FixedHeightLayoutCache) still holds a reference to the last selected node in info.node. There is no real solution on the Java side except: ((JTree)((MyBeanTreeView)elementView).getComponent()).setSelectionModel(new DefaultTreeSelectionModel()); which will fix just the single instance of BeanTreeView, unfortunately I don't see any nice fix even in TreeView. One possibility is that ExplorerManager.setRootContext() will reset the selection model.
Unfortunately I was not able to reproduce the exact scenario with TreeView reference being kept by CompositionAreaHandler (I tried both JDK7 and JDK8), but I noticed there is MembersView reference kept in NavigatorTC after the last project is closed so I will fix that.
fix: http://hg.netbeans.org/core-main/rev/4fe8f3f80245
Integrated into 'main-silver', will be available in build *201308072300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/4fe8f3f80245 User: Jan Peska <JPESKA@netbeans.org> Log: Issue #233251 - memory leak in java.navigation.ElementNode Release references after the navigator panel is empty.