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 125057 - memory leak in org.netbeans.core.NbSheet
Summary: memory leak in org.netbeans.core.NbSheet
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 123530
  Show dependency tree
 
Reported: 2008-01-10 19:45 UTC by Quy Nguyen
Modified: 2008-12-22 10:15 UTC (History)
1 user (show)

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 Quy Nguyen 2008-01-10 19:45:50 UTC
The NbSheet.nodes field retains nodes that may no longer be in use, even when the properties window is closed.  This has
an effect on visual web projects that have been closed, since model objects are attached to the DesignBeanNode objects
held by NbSheet.

To reproduce:
1) Create a web project w/ the visualweb framework
2) Close the navigator window (suppresses another memory leak)
3) DnD some components to the page
4) Close Page1.jsp and close the project

After doing this, the properties window is closed, but the nodes are still held by NbSheet.  To clear them, the
properties window needs to be opened again.
Comment 1 Stanislav Aubrecht 2008-01-14 13:45:16 UTC
fixed

/cvs/core/src/org/netbeans/core/NbSheet.java,v  <--  NbSheet.java
new revision: 1.41; previous revision: 1.40
done
Checking in test/unit/src/org/netbeans/core/NbSheetTest.java;
/cvs/core/test/unit/src/org/netbeans/core/NbSheetTest.java,v  <--  NbSheetTest.java
new revision: 1.4; previous revision: 1.3
Comment 2 Shivanand Kini 2008-01-16 00:45:41 UTC
saubrecht,
PropertySheet.helperNodes also need to be cleared off, by calling propertySheet.setNodes(new Node[0] or null?) in
NbSheet.componentClosed()

Also see, http://www.netbeans.org/issues/show_bug.cgi?id=125322
Comment 3 Shivanand Kini 2008-01-16 01:45:56 UTC
The nodes also need to be cleared off from the SheetNodesListener. Though, I may not have waited for nodeDestroyed to be
called, during my profiling.

Just a thought, do you think it is better to call setNodes(new Node[0]) in componentClosed(), instead of 

nodes = null;
propertySheet.setNode...;
...


Comment 4 Stanislav Aubrecht 2008-01-17 12:17:52 UTC
fixed

Checking in core/src/org/netbeans/core/NbSheet.java;
/cvs/core/src/org/netbeans/core/NbSheet.java,v  <--  NbSheet.java
new revision: 1.43; previous revision: 1.42
done
Checking in core/test/unit/src/org/netbeans/core/NbSheetTest.java;
/cvs/core/test/unit/src/org/netbeans/core/NbSheetTest.java,v  <--  NbSheetTest.java
new revision: 1.5; previous revision: 1.4
done
Checking in openide/explorer/test/unit/src/org/openide/explorer/propertysheet/PropertySheetTest.java;
/cvs/openide/explorer/test/unit/src/org/openide/explorer/propertysheet/PropertySheetTest.java,v  <--  PropertySheetTest.java
new revision: 1.4; previous revision: 1.3
done
Checking in openide/explorer/src/org/openide/explorer/propertysheet/PropertySheet.java;
/cvs/openide/explorer/src/org/openide/explorer/propertysheet/PropertySheet.java,v  <--  PropertySheet.java
new revision: 1.23; previous revision: 1.22