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 50572

Summary: MainClassUpdater hanging around after project closed
Product: projects Reporter: Antonin Nebuzelsky <anebuzelsky>
Component: Generic InfrastructureAssignee: Antonin Nebuzelsky <anebuzelsky>
Status: CLOSED FIXED    
Severity: blocker CC: issues, pnejedly
Priority: P2 Keywords: PERFORMANCE
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 41535, 49247    
Attachments: MainClassUpdater instances not disposed

Description Antonin Nebuzelsky 2004-10-18 17:13:32 UTC
After an opened project is closed its
MainClassUpdater instance keeps hanging around.
However, all I see in OptimizeIt is a reference
path through WeakListenerImpl$PropertyChange to

MainClassUpdater <- element of ArrayList <-
elementData  of WLI$PropertyChange <- listeners of
PropertyUtils$SequentialPropertyEvaluator <-
standardPropertyEvaluator of ProjectProperties <-...

I don't see any direct hard reference.
Investigation of the code at
( does not reveal any local
variable holding a reference to it either.

Petre, could you please have a look at this in
INSANE? Maybe you'll find a reference path
OptimizeIt does not show me.... Thanks.
Comment 1 Petr Nejedly 2004-10-19 13:50:58 UTC
Here is the reference chain:


Not only MainClassUpdater is kept but also a bunch of other objects
including the J2SEProject:


It seems to me that the problem is sharing the user properties.
Comment 2 Jesse Glick 2004-10-19 16:28:47 UTC
OPL should not hold a ref to the prj when the prj is closed.
Comment 3 Petr Hrebejk 2004-10-19 16:47:28 UTC
It does not. According to Petr Nejedly he had two projects unrelated
projects. He kept one open (the one referenced from OPL) and opened
and closed the other one. 
The second one seems to be hold in memory through some listener on
Comment 4 Jesse Glick 2004-10-19 17:11:55 UTC
Forgotten WeakListeners usage, I think.
Comment 5 Jesse Glick 2004-10-19 19:04:39 UTC
committed   * Up-To-Date  1.24       
committed   * Up-To-Date  1.14       

Found a fixed one leak, please verify that this fixed the problem or
file a new issue with a new leak chain.
Comment 6 Petr Nejedly 2004-10-20 10:28:45 UTC
The closed project is still referenced:


Strange that Insane haven't found this shorter reference chain before.
A newly introduced leak? Reassigning to phrebejk.
Comment 7 Petr Hrebejk 2004-10-20 15:51:32 UTC
Yet another reference fixed. Let's see what will come next. Please verify.

Checking in
new revision: 1.9; previous revision: 1.8
Comment 8 Petr Nejedly 2004-10-21 15:58:26 UTC
Finally fixed now.
Comment 9 Antonin Nebuzelsky 2004-10-22 16:35:59 UTC
Disagree. You perhaps fixed something else than what this issue
originally was about. :) I still see cumulating instances of
MainClassUpdater when I repeatedly open and close a project.

The reduced reference graph in OptimizeIt just shows one reference
path. Seee the attached screenshot.
Comment 10 Antonin Nebuzelsky 2004-10-22 16:39:03 UTC
Created attachment 18454 [details]
MainClassUpdater instances not disposed
Comment 11 Petr Nejedly 2004-10-22 22:15:22 UTC
It was OK for my test case.
Anyway, Projects can hardly fix the reference chain you posted, as the
source file from the project is held by MDR.
How much are they accumulating? How is the accumulation affected by
the size of the AST cache?
Comment 12 Petr Hrebejk 2004-10-25 17:05:58 UTC
Please insane it again with petr and if assign to who ever maintains
the code holding that object.

Comment 13 Antonin Nebuzelsky 2004-11-03 14:54:50 UTC
Setting back to FIXED. The instances are hagning there only temporarily.
Comment 14 Jaromir Uhrik 2005-07-14 16:19:07 UTC