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 69183 - 5 instances of SimpleLookup$SimpleResult leaking with each Clean and Build invocation
Summary: 5 instances of SimpleLookup$SimpleResult leaking with each Clean and Build in...
Status: RESOLVED DUPLICATE of bug 70578
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2005-11-23 14:01 UTC by Antonin Nebuzelsky
Modified: 2008-12-22 16:51 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
OptimizeIt screenshot 1 (83.66 KB, image/png)
2005-11-23 14:02 UTC, Antonin Nebuzelsky
Details
OptimizeIt screenshot 2 (85.35 KB, image/png)
2005-11-23 14:03 UTC, Antonin Nebuzelsky
Details
OptimizeIt screenshot 3 (90.41 KB, image/png)
2005-11-23 14:06 UTC, Antonin Nebuzelsky
Details
OptimizeIt screenshot 4 (84.28 KB, image/png)
2005-11-23 14:07 UTC, Antonin Nebuzelsky
Details
OptimizeIt screenshot 5 (90.34 KB, image/png)
2005-11-23 14:08 UTC, Antonin Nebuzelsky
Details
List of leaking instances after 3 Clean and Build invocations (79.38 KB, image/png)
2005-11-23 14:11 UTC, Antonin Nebuzelsky
Details
Cumulated instance after one invocation of Clean & Build action (76.57 KB, image/png)
2005-12-16 10:17 UTC, Antonin Nebuzelsky
Details
Cumulated instances after two invocations of Clean & Build action (76.23 KB, image/png)
2005-12-16 10:18 UTC, Antonin Nebuzelsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2005-11-23 14:01:25 UTC
I see in profiler that each invocation of Clean and Build action on a J2SE
project  leaves 5 instances of SimpleLookup$SimpleResult on heap. I am attaching
5 screenshots of OptimizeIt window showing reference paths for the leaked
instances. 4 of them were created from code in
GlobalActionContextImpl.blickActionMap(), the fifth one comes from a different
code - see the allocation path on the screenshots.
Comment 1 Antonin Nebuzelsky 2005-11-23 14:02:37 UTC
Created attachment 27200 [details]
OptimizeIt screenshot 1
Comment 2 Antonin Nebuzelsky 2005-11-23 14:03:38 UTC
Created attachment 27201 [details]
OptimizeIt screenshot 2
Comment 3 Antonin Nebuzelsky 2005-11-23 14:06:10 UTC
Created attachment 27202 [details]
OptimizeIt screenshot 3
Comment 4 Antonin Nebuzelsky 2005-11-23 14:07:15 UTC
Created attachment 27203 [details]
OptimizeIt screenshot 4
Comment 5 Antonin Nebuzelsky 2005-11-23 14:08:20 UTC
Created attachment 27204 [details]
OptimizeIt screenshot 5
Comment 6 Antonin Nebuzelsky 2005-11-23 14:11:03 UTC
BTW, there are also other lookup objects leaking. See another screenshot - list
of leaking instances after 3 invocations of Clean and Build (thus the +15
leaking SimpleLookup$SimpleResult objects). Let me know if you need more
information.
Comment 7 Antonin Nebuzelsky 2005-11-23 14:11:56 UTC
Created attachment 27205 [details]
List of leaking instances after 3 Clean and Build invocations
Comment 8 Jaroslav Tulach 2005-11-24 16:00:30 UTC
I'd like to know why the problem is supposed to be in lookup? Can't you 
reassign Tonda to someone who really holds the leak? For example on of the 
reference roots in the picture? 
Comment 9 Antonin Nebuzelsky 2005-11-24 16:07:06 UTC
Pardon my ignorance. But I just wanted the issue to be assigned to you, because
I saw in CVS annotations that you were the last one to do changes to the method
GlobalActionContextImpl.blickActionMap(). If you disagree, assign to me, and I
will try to find another owner.
Comment 10 Jaroslav Tulach 2005-11-25 07:28:55 UTC
But blickActionMap is not in openide/lookup! 
Comment 11 Jaroslav Tulach 2005-12-09 10:47:20 UTC
lookup is not responsible for what people do with it, nor where they store its   
results. For example having HashMap called lookups is not very likely what 
EditorContextImpl shall do. 
Comment 12 Martin Entlicher 2005-12-09 16:27:51 UTC
EditorContextImpl has to store 3 lookup results so that it can listen on them.
They were stored in a hash map, now they are in class fields - but the result is
the same. The single EditorContextImpl instance holds just three lookup results.

From an analysis in OptimizeIt we did with Tonda it looks like the problem is
really in GlobalActionContextImpl.blickActionMap() where a new ProxyLookup is
created, which clones the orig. lookup or someweher around that stack...
The EditorContextImpl itself does not seem to create the leak. Moving to
openide/windows for evaluation, there's the GlobalActionContextImpl defined.
Comment 13 Antonin Nebuzelsky 2005-12-13 09:13:28 UTC
Talked about this with Yarda. Reassigning to him.
Comment 14 Jaroslav Tulach 2005-12-14 15:48:31 UTC
The code has been rewritten a bit recently, and today when I tried to invoke 
"clean & build" few times and the amount of results stayed constant - 7 all 
the time. 
Comment 15 Antonin Nebuzelsky 2005-12-16 10:12:25 UTC
Unfortunatelly, the problem did not disappear. See the following two OptimizeIt
screenshots.
Comment 16 Antonin Nebuzelsky 2005-12-16 10:14:26 UTC
Taken with build 200512152030.
Comment 17 Antonin Nebuzelsky 2005-12-16 10:17:09 UTC
Created attachment 27886 [details]
Cumulated instance after one invocation of Clean & Build action
Comment 18 Antonin Nebuzelsky 2005-12-16 10:18:02 UTC
Created attachment 27887 [details]
Cumulated instances after two invocations of Clean & Build action
Comment 19 Antonin Nebuzelsky 2005-12-16 10:22:03 UTC
INSANE shows the following reference path for one of the instances of ProxyLookup$R:

org.netbeans.modules.project.ui.actions.Actions.RENAME_PROJECT->
org.netbeans.modules.project.ui.actions.ProjectAction@186bf64->
[Lorg.openide.util.Lookup$Result;@eb6305->
org.openide.util.lookup.SimpleProxyLookup$ProxyResult@13af36f->
org.openide.util.lookup.ProxyLookup$R@db0a6f->
javax.swing.event.EventListenerList@11f0e1d->
[Ljava.lang.Object;@5a11ba->
org.openide.util.lookup.ExcludingLookup$R@1ae9c34->
org.openide.util.lookup.ProxyLookup$R@af5747

The ExcludingLookup$R seems to be listening on a result of the original lookup.

Perhaps the blickActionMap() should first clean the listener paths for the
previous temporary lookup before it creates new temporary lookup?
Comment 20 Michal Mocnak 2005-12-19 10:07:54 UTC
Closed as duplicate. A new one has fixed attachments due to this problem: issue
#70577

*** This issue has been marked as a duplicate of 70578 ***