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 125961 - memory leak in LiveUnit.listeners
Summary: memory leak in LiveUnit.listeners
Status: RESOLVED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: _ sandipchitale
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 123530
  Show dependency tree
 
Reported: 2008-01-24 22:27 UTC by Quy Nguyen
Modified: 2008-01-30 18:55 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 Quy Nguyen 2008-01-24 22:27:55 UTC
To reproduce:
1) Create a vw project
2) Add a table component to the page
3) Delete the component
4) Clean-Build the project
5) repeat steps 2-4 as needed

This appears to cause a memory leak in the LiveUnit.listeners field.

[#document: null]:
java.awt.EventDispatchThread@aae359-threadLocals->
java.lang.ThreadLocal$ThreadLocalMap@1994823-table->
[Ljava.lang.ThreadLocal$ThreadLocalMap$Entry;@1de7a22-[479]->
java.lang.ThreadLocal$ThreadLocalMap$Entry@1f41719-value->
org.netbeans.modules.visualweb.jsfsupport.container.RaveFacesContext@31b070-liveContext->
org.netbeans.modules.visualweb.insync.live.LiveUnit@1ae6feb-listeners->
java.util.ArrayList@136f67d-elementData->
[Ljava.lang.Object;@a93492-[61]->
org.netbeans.modules.visualweb.insync.live.DesignBeanNode$BeanChildren@14b4add-parent->
org.netbeans.modules.visualweb.insync.live.FacesDesignBean@d784bb-bean->
org.netbeans.modules.visualweb.insync.faces.FacesBean@1f2abb5-element->
org.netbeans.modules.visualweb.designer.markup.RaveElement@f8036e-ownerDocument->
org.netbeans.modules.visualweb.designer.markup.RaveSourceDocument@1ada746
Comment 1 _ sandipchitale 2008-01-25 17:49:26 UTC
Looking at it.
Comment 2 _ sandipchitale 2008-01-28 19:07:28 UTC
I am able to see the leak.
Comment 3 _ sandipchitale 2008-01-30 05:15:16 UTC
Looks like the DesignContextListener is registered in:

org.netbeans.modules.visualweb.insync.live.DesignBeanNode.BeanChildren.addNotify()

and removed in:

org.netbeans.modules.visualweb.insync.live.DesignBeanNode.BeanChildren.removeNotify()

However the Javadoc for:

org.openide.nodes.Children.removeNotify()

says:

"Note that this is usually not the best place for unregistering listeners, etc., as listeners usually keep the child
nodes in memory, preventing them from being collected, thus preventing this method to be called in the first place."

Thus the listener need to removed in some other place e.g. when the beans is deleted/destroyed. Investigating further...
Comment 4 _ sandipchitale 2008-01-30 18:55:27 UTC
Fixed:

changeset:   65211:035aad3d1eaf
user:        Sandip V. Chitale <sandipchitale@netbeans.org>
date:        Wed Jan 30 10:24:27 2008 -0800
summary:     Bug Fix # 125961 memory leak in LiveUnit.listeners