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.
If you search in filesystems and then click Show All Details for the found result set, the displayed details (o.n.m.search.types.FullTextType$DetailNode) are kept in memory forever together with the instances of o.n.m.search.types.TextDetail and other instances to which FullTextType$DetailNode keep references. They are kept in memory even if you close both the Search Results and Output windows so that these windows are empty when reopened. (BTW, the output window has to be closed by CTRL+F4 or Close from its popup; clicking its close icon does not clean its contents; this is a separate problem but should be fixed as well) See the attached screenshots of jprofiler windows.
Created attachment 16606 [details] Table listing the leaked instances of o.n.m.search.*
Created attachment 16607 [details] Reference path which keeps the instances in memory
It seems this bug is related to bug #45129 ("Search -> ... -> Show Details does not release some I/O stream for output window"). Fixing bug #45129, together with a proper algorithm of releasing unused objects, should fix this bug.
Fixed in the trunk, together with bugs #45129 ("Search -> ... -> Show Details does not release some I/O stream for output window") and #33190 ("User should click to 'Show details' button more than once"). Modified files: Manager.java (1.3) PrintDetailsTask.java (1.3) SearchDisplayer.java (1.15)
Almost... ;o) There is still one case when instances of the previous search are unnecessarily occupying memory. When you do a first search, then show all details and then do another search via Modify Search. The instances of FullTextType$DetailNode and TextDetai from the first search are still kept in memory. The instances are then cleared together with the new instances when you close the Search Results window but until then they are "leaked".
Created attachment 16625 [details] One more screeshot (the green instances should not be in memory any more)
Fixed in the trunk. Modified files: utilities/src/org/netbeans/modules/search/Manager.java (1.5) utilities/src/org/netbeans/modules/search/PrintDetailsTask.java (1.4) utilities/src/org/netbeans/modules/search/SearchDisplayer.java (1.16)
Verified. Thanks!