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 87743

Summary: Leaking org.netbeans.modules.buildmonitor.BuildStatus
Product: contrib Reporter: _ rkubacki <rkubacki>
Component: CodeAssignee: Jesse Glick <jglick>
Status: VERIFIED FIXED    
Severity: blocker    
Priority: P4    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description _ rkubacki 2006-10-23 08:53:45 UTC
Dev build of IDE from Oct 19, buildmonitor module version 1.7

From my IDE heap dump I see leaking instances of
org.netbeans.modules.buildmonitor.BuildStatus (124). There is a property change
support for BuildMonitor that holds all of them so probably status is not
detached as listener when it is replaced with new instance in BuildPanel.
Reference chain looks like this:


Static reference from
org.netbeans.modules.buildmonitor.BuildMonitorPanel.instance (from class
org.netbeans.modules.buildmonitor.BuildMonitorPanel) :
--> org.netbeans.modules.buildmonitor.BuildMonitorPanel@0xa4a215b8 (324 bytes)
(field component:)
--> [Ljava.awt.Component;@0xa41c7ec0 (12 bytes) (Element 0 of
[Ljava.awt.Component;@0xa41c7ec0:)
--> org.netbeans.modules.buildmonitor.BuildStatus@0xa7e9aba8 (467 bytes) (field
monitor:)
--> org.netbeans.modules.buildmonitor.BuildMonitor@0xa33a26a8 (68 bytes) (field
pcs:)
--> java.beans.PropertyChangeSupport@0xa461e8c0 (24 bytes) (field listeners:)
--> sun.awt.EventListenerAggregate@0xa41cfe18 (12 bytes) (field listenerList:)
--> [Ljava.beans.PropertyChangeListener;@0xa7df5770 (508 bytes) (Element 120 of
[Ljava.beans.PropertyChangeListener;@0xa7df5770:)
--> org.netbeans.modules.buildmonitor.BuildStatus@0xa7e99f68 (467 bytes)
Comment 1 _ rkubacki 2006-10-23 09:27:27 UTC
What about calling monitor.addPropertyChangeListener(this); in
BuildStatus.addNotify() and removing it in removeNotify rather than just
registeing itself as PCL in contructor.
Comment 2 Jesse Glick 2006-10-23 16:55:41 UTC
Sure. Didn't realize the status line component would be recreated so many times.

Checking in src/org/netbeans/modules/buildmonitor/BuildStatus.java;
/shared/data/ccvs/repository/contrib/buildmonitor/src/org/netbeans/modules/buildmonitor/BuildStatus.java,v
 <--  BuildStatus.java
new revision: 1.4; previous revision: 1.3
done
Checking in manifest.mf;
/shared/data/ccvs/repository/contrib/buildmonitor/manifest.mf,v  <--  manifest.mf
new revision: 1.8; previous revision: 1.7
done
Comment 3 _ rkubacki 2006-11-03 14:43:20 UTC
thanks. This was not a big problem.