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 124061

Summary: Memory leak via Navigator
Product: platform Reporter: Jaroslav Tulach <jtulach>
Component: NavigatorAssignee: David Simonek <dsimonek>
Status: RESOLVED FIXED    
Severity: blocker CC: jglick, mkubec
Priority: P2 Keywords: PERFORMANCE, TEST
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 121855    

Description Jaroslav Tulach 2007-12-14 23:37:16 UTC
I can see a leak going to closed Java project thru navigator. Not really surprising, as the navigator still shows 
something even all editors are closed and explorer tab is empty. But maybe the problem is in GlobFileBuiltQuery.

Checking if all projects are really garbage collected Project: private static 
org.netbeans.modules.navigator.NavigatorTC org.netbeans.modules.navigator.NavigatorTC.instance-> 
org.netbeans.modules.navigator.NavigatorTC@139c41d-activatedNodes-> [Lorg.openide.nodes.Node;@eb28de-[0]-> 
org.openide.nodes.FilterNode@1102b52-original-> org.netbeans.modules.java.JavaNode@16a53bb-status-> 
org.netbeans.spi.project.support.ant.GlobFileBuiltQuery$StatusImpl@9f0a1b-this$0-> 
org.netbeans.spi.project.support.ant.GlobFileBuiltQuery@14984f6-helper-> 
org.netbeans.spi.project.support.ant.AntProjectHelper@e6750f-state-> 
org.netbeans.api.project.ProjectManager$ProjectStateImpl@d2b66d-p-> 
org.netbeans.modules.java.j2seproject.J2SEProject@afa2c2
Comment 1 Jaroslav Tulach 2008-01-11 09:40:39 UTC
the performance team would like to ask your teams for help with making memory 
leak tests part of the commit validation.

One of the main performance goals for 6.1 is to fix memory leaks in main use 
cases and prevent regressions in future. As the first step the performance 
team plans to extend the commit validation tests by checking whether certain 
important data structures are freed from memory after the tests finish.

All leaks found so far are filed under 121855 umbrella issue:
http://openide.netbeans.org/issues/showdependencytree.cgi?id=121855

As you can see, the number of issues is not high (14 at this moment, some of 
them already fixed). We need to fix the rest - and fix leaks that appear in 
the future preferentially (as part of commit validation). Thus we will make 
the issues of P2 priority.
Comment 2 Jaroslav Tulach 2008-01-24 13:18:13 UTC
Making P2 as previously announced.
Comment 3 Jaroslav Tulach 2008-02-22 13:45:50 UTC
The leak is still there. Please concentrate on fixing it:

      junit.framework.AssertionFailedError: Checking if all projects are really garbage collected Project:
private static org.netbeans.modules.navigator.NavigatorTC org.netbeans.modules.navigator.NavigatorTC.instance->
org.netbeans.modules.navigator.NavigatorTC@482417-activatedNodes->
[Lorg.openide.nodes.Node;@a651cb-[0]->
org.openide.nodes.FilterNode@1573b05-original->
org.netbeans.modules.java.JavaNode@8132bb-status->
org.netbeans.spi.project.support.ant.GlobFileBuiltQuery$StatusImpl@1fb0646-this$0->
org.netbeans.spi.project.support.ant.GlobFileBuiltQuery@1acc3f1-helper->
org.netbeans.spi.project.support.ant.AntProjectHelper@195aab2-state->
org.netbeans.api.project.ProjectManager$ProjectStateImpl@19975e8-p->
org.netbeans.modules.java.j2seproject.J2SEProject@1949c1e
Comment 4 David Simonek 2008-02-27 11:01:45 UTC
I don't know what is commit validation doing with Navigator, but it does some strange things which I can't reproduce as
normal user. How can I debug it? I tried to write some debug prints, but they didn't appear in commit validation logs, why?
Seems that our test infrastructure needs expert level which i can't reach :-)
Comment 5 David Simonek 2008-02-28 16:04:01 UTC
finally reproduced without commit validation and fixed, also some logging added:

http://hg.netbeans.org/main/rev/be33bfc7b67d
Comment 6 David Simonek 2008-02-28 16:09:41 UTC
finally reproduced without commit validation and fixed, also some logging added:

http://hg.netbeans.org/main/rev/be33bfc7b67d
Comment 7 Jaroslav Tulach 2008-02-29 22:15:24 UTC
Commit validation just failed. I guess we need an additional solution. And I am saying solution, as I am quite fine 
with modifying the test to clear the NavigatorTC directly, even with reflection. Of course, it would be good if the 
behaviour of navigator was reasonable as well, however making the test pass is much higher priority now.


junit.framework.AssertionFailedError: Checking if all projects are really garbage collected Project:
private static org.netbeans.modules.navigator.NavigatorTC org.netbeans.modules.navigator.NavigatorTC.instance->
org.netbeans.modules.navigator.NavigatorTC@1f0c4d2-activatedNodes->
[Lorg.openide.nodes.Node;@28deb2-[0]->
org.openide.nodes.FilterNode@77947-original->
org.netbeans.modules.java.JavaNode@14c721c-status->
org.netbeans.spi.project.support.ant.GlobFileBuiltQuery$StatusImpl@b5d521-this$0->
org.netbeans.spi.project.support.ant.GlobFileBuiltQuery@1477d5d-helper->
org.netbeans.spi.project.support.ant.AntProjectHelper@1ced1a9-state->
org.netbeans.api.project.ProjectManager$ProjectStateImpl@43372b-p->
org.netbeans.modules.java.j2seproject.J2SEProject@1c4af44
        at junit.framework.Assert.fail(Assert.java:47)
        at org.netbeans.junit.NbTestCase.assertGC(NbTestCase.java:1203)
        at org.netbeans.junit.NbTestCase.assertGC(NbTestCase.java:1152)
Comment 8 David Simonek 2008-03-03 15:43:37 UTC
Okay, it seems that I'm really unable to fix the leak properly. Fortunately it's a leak that will last only for few
seconds in real usage, so I've given up and closed navigator window before GC test 

http://hg.netbeans.org/main/rev/3097d918cff9