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 - Leaking org.netbeans.modules.buildmonitor.BuildStatus
Summary: Leaking org.netbeans.modules.buildmonitor.BuildStatus
Status: VERIFIED FIXED
Alias: None
Product: contrib
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-23 08:53 UTC by _ rkubacki
Modified: 2007-12-07 16:34 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 _ 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.