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.
http://deadlock.netbeans.org/hudson/job/NB-Core-Build/3408/testReport/org.netbeans.test.ide/MemoryValidationTest/testGCDocuments/? junit.framework.AssertionFailedError: Are all documents GCed? TextDocument: private static java.util.Map org.netbeans.modules.project.ui.ProjectTab.tabs-> java.util.HashMap@93e411-table-> [Ljava.util.HashMap$Entry;@3542ef-[10]-> java.util.HashMap$Entry@17cf829-value-> org.netbeans.modules.project.ui.ProjectTab@1f5cf83-btv-> org.netbeans.modules.project.ui.ProjectTab$ProjectTreeView@8273c7-visHolder-> org.openide.explorer.view.TreeView$VisualizerHolder@501bee-map-> java.util.HashMap@37aea1-table-> [Ljava.util.HashMap$Entry;@be31f3-[10]-> java.util.HashMap$Entry@75e373-key-> org.openide.explorer.view.VisualizerChildren@fbda05-visNodes-> java.util.ArrayList@bf70bd-elementData-> [Ljava.lang.Object;@5e6be2-[5]-> org.openide.explorer.view.VisualizerNode@85f82d-node-> org.openide.nodes.FilterNode@1042826-original-> org.openide.nodes.CookieSet@16de563-ic-> org.openide.nodes.CookieSetLkp@da478a-tree-> org.openide.util.lookup.ArrayStorage@d1d15d-content-> [Ljava.lang.Object;@15beae8-[1]-> org.openide.nodes.CookieSetLkp$SimpleItem@1e80c8f-obj-> org.openide.text.EditorSupportLineSet@11b8a08-listener-> org.openide.text.LineListener@78ea99-root-> org.netbeans.editor.LineRootElement@4ec4fe-doc-> org.netbeans.modules.editor.NbEditorDocument@b1de2d According to the snapshot linked from the above page, the editor is closed. So there is some potential problem with synchronization - the EditorSupportLineSet should keep offsets only and not the document anymore.
I have not reproduced the problem locally however. The command: cd java.kit i=0; while ant test-single -Dtest.includes=**/MemoryVali*Test* -Dtest.type=qa-functional; do i=`expr $i + 1`; echo $i; done; echo Finished: $i succeeded seven times in a row without a failure. Petr J., did you see a failure somewhere?
Yes, on other team builders: http://bertram.netbeans.org/hudson/job/web-main/1834/testReport/org.netbeans.test.ide/MemoryValidationTest/testGCDocuments/? http://deadlock.netbeans.org/hudson/job/ruby/3203/testReport/org.netbeans.test.ide/MemoryValidationTest/testGCDocuments/? http://bertram.netbeans.org/hudson/job/cdev/1534/testReport/org.netbeans.test.ide/MemoryValidationTest/testGCDocuments/? http://bertram.netbeans.org/hudson/job/cnd-main/1917/testReport/org.netbeans.test.ide/MemoryValidationTest/testGCDocuments/? http://bertram.netbeans.org/hudson/job/community-main/149/testReport/org.netbeans.test.ide/MemoryValidationTest/testGCDocuments/? I will try locally also.
Created attachment 89591 [details] hg bundle to workaround the problem
Anyone (or all of you) feeling blocked by the problem, feel free to integrate the workaround into your repository: wget http://www.netbeans.org/nonav/issues/showattachment.cgi/89591/workaround-for-issue-174713.hg hg unbundle workaround-for-issue-174713.hg hg merge hg ci -m "Merge of workaround for #174713" I will continue investigating the real cause of the problem meanwhile.
I have reproduced the failure locally, but I still do not have a clue how it can happen. From the list of references one would say that there is an instance of org.openide.nodes.CookieSetLkp$SimpleItem which has field obj pointing to org.openide.text.EditorSupportLineSet. But when I add debug message: diff -r 1f650edec019 openide.nodes/src/org/openide/nodes/CookieSetLkp.java --- a/openide.nodes/src/org/openide/nodes/CookieSetLkp.java Thu Oct 15 12:11:32 2009 +0200 +++ b/openide.nodes/src/org/openide/nodes/CookieSetLkp.java Fri Oct 16 11:36:50 2009 +0200 @@ -157,6 +157,10 @@ throw new NullPointerException(); } this.obj = obj; + System.err.println("SimpleItem: " + obj.getClass().getName()); + if (obj.getClass().getName().contains("EditorSupportLineSet")) { + Thread.dumpStack(); + } } Nothing is printed and breakpoint in the dumpStack() line does not stop.
I guess INSANE went insane. I managed to generate heap dump when the test fails and it claims that NbEditorDocument is referenced from a (Java Frame) directly. I think this means that the document is on stack of some thread that is just being executed. Too bad the test does not produce thread dump as well.
I also was not able to find out who is responsible for this ie. who adds reference to EditorSupportLineSet in CookieSetLkp. Reference to document from CloneableEditorSupport->EditorSupportLineSet is cleared when document is closed. (Otherwise it would be reported in test.) IMO problem is not in openide.text.
Created attachment 89634 [details] Surprise: The leak comes from Ant module, not java!
Created attachment 89635 [details] Unit test simulating the failure
core-main#04860c675e0c definitely helps with the memory leak. Hopefully it will not release ESLineSet too often.
Not really related to the Ant module per se, I guess - would happen if the selected node in Projects tab were any file with an editor.
jtulach - you need to also push your workaround 2696ffe89ea8 to core-main, I guess also with a follow-up changeset that backs it out. This will restore the test after it has been disabled on team builders. (I pushed the workaround to cdev and others may be doing the same in other builders.)
I'll enable the test as soon as beta is branched.
I backed out http://hg.netbeans.org/main-golden/rev/04860c675e0c due to several P1 regressions - see issue #175578, issue #175646.
Since this is random and so far has only been reported from tests I'm lowering the priority to P3.
Bug prior to 7.0, not touched for the last 2 years --> P4.
Petr, can you pleease have a look? Is this still a problem? Thanks.
This is no longer a problem, must have been fixed in the meantime.