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.
steps to reproduce: 1. open a bunch of maven projects, after scanning finishes, close them again. 2. create a basic ant j2se project (to clean up any context residue) 3. click GC a few times 4. create a heap dump. In the heap dump, look for NbMavenProjectImpl (the project implementation for maven projects), all of them are still referenced. See screenshot for the nearest GC root found in all instances. http://screencast.com/t/u79FO8Hh adding tzezula on CC - according to him it's not clear why the DeepListener is held. P1 as the leak is fairly big (projects have a lot of other objects associated with them). I haven't tested non maven projects but I assume the problem is not project specific heap dump: https://s3-eu-west-1.amazonaws.com/mkleint-parachute-test/heapdump-1394006171934.hprof.gz Product Version: NetBeans IDE Dev (Build 20140303-876539d8b52d) Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56 Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43 System: Mac OS X version 10.8.5 running on x86_64; UTF-8; en_US (nb) User directory: /Users/mkleint/src/core-main-backup/nbbuild/testuserdir Cache directory: /Users/mkleint/src/core-main-backup/nbbuild/testuserdir/var/cache
Tomas/Jirka, could you please investigate how big impact it has on the memory, also check other project types ... thanks in advance. based on your findings we will decide to fix/reject this for 8.0.
We did some testing with Jirka and similar problem exists in NB 7.4 too. In the heap dump from NB 8.0 we saw two different paths to GC root holding maven projects, none of them are similar to the one reported by Milos. There is a similar test for j2se projects and unfortunately during NB 8.0 development cycle, we were not able to fix all the project oriented leaks so this test never passed. I think, if someone has the easy fix than we can put it in, but I am afraid that there is several problems on different levels and it cannot be fixed easily.
If I understand correctly, a recursive listener is registered by RepositoryUpdater.RootListeners when a source root is added, and unregistered when a source root is removed. There are 25 listeners in DeepListener.keep list, and there are 23 items in RepositoryUpdater.RootListeners.sourceRoots, corresponding to the listeners. So it seems that some source roots were not removed from the RepositoryUpdater.RootListeners, and thus the recursive listeners kept registered.
One place where a reference is held is navigator panel for Maven project. Underlaying JTree of BeanTreeView holds a VisualizerNode with o.n.m.maven.execute.navigator.GoalsPanel$PluginChildren, even if the node is not in explorer manager's context. Expanding the "mock" node currently contained in the tree view seems to fix this problem. http://hg.netbeans.org/core-main/rev/f9c16934f1f5 Suggestions for some cleaner fix are welcome.
Integrated into 'main-silver', will be available in build *201507180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/f9c16934f1f5 User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #242567: Refresh tree view which holds reference to closed Maven project
In some cases, projects were referenced from SetMainProject action (some Swing component indirectly holding project root node). http://hg.netbeans.org/core-main/rev/0e2f6ddbd376
Integrated into 'main-silver', will be available in build *201507220303* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/0e2f6ddbd376 User: Jaroslav Havlin <jhavlin@netbeans.org> Log: #242567: Reference projects from SetMainProject weakly
Adding 8.1_WAIVER_REQUEST keyword. Some places where projects were held are already fixed. The last unresolved case seems to be related to background scanning or filesystems. Any reliable solution for it hasn't been found yet. Thank you for understanding.
Bug waiver for 8.1 approved.
I confirm that multi module JEE projects consumes 90% of my RAM Product Version: NetBeans IDE 8.1 (Build 201510222201) Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1 Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11 System: Windows 7 version 6.1 running on amd64; Cp1253; en_US (nb)
I don't know if this is relevant but: in maven projects having a mirror of * (look above) in settings.xml file, leads to halting the system as it consumes all memory <mirrors> <mirror> <id>some-public-group</id> <mirrorOf>*,!some-snapshots</mirrorOf> <url>https://url.of.some.com/groups/public</url> </mirror> </mirrors> if i comment out the whole mirror and restart Netbeans it does not lead to a halting system