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 46828 - Show All Details of found results leaves a memory leak
Summary: Show All Details of found results leaves a memory leak
Status: CLOSED FIXED
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 4.x
Hardware: PC All
: P2 blocker (vote)
Assignee: issues@utilities
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2004-08-02 13:27 UTC by Antonin Nebuzelsky
Modified: 2006-03-24 10:21 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Table listing the leaked instances of o.n.m.search.* (114.91 KB, image/png)
2004-08-02 13:28 UTC, Antonin Nebuzelsky
Details
Reference path which keeps the instances in memory (178.57 KB, image/png)
2004-08-02 13:29 UTC, Antonin Nebuzelsky
Details
One more screeshot (the green instances should not be in memory any more) (139.36 KB, image/png)
2004-08-03 14:23 UTC, Antonin Nebuzelsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Antonin Nebuzelsky 2004-08-02 13:27:56 UTC
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.
Comment 1 Antonin Nebuzelsky 2004-08-02 13:28:58 UTC
Created attachment 16606 [details]
Table listing the leaked instances of o.n.m.search.*
Comment 2 Antonin Nebuzelsky 2004-08-02 13:29:40 UTC
Created attachment 16607 [details]
Reference path which keeps the instances in memory
Comment 3 Marian Petras 2004-08-03 09:44:26 UTC
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.
Comment 4 Marian Petras 2004-08-03 10:48:52 UTC
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)
Comment 5 Antonin Nebuzelsky 2004-08-03 14:14:43 UTC
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".
Comment 6 Antonin Nebuzelsky 2004-08-03 14:23:40 UTC
Created attachment 16625 [details]
One more screeshot (the green instances should not be in memory any more)
Comment 7 Marian Petras 2004-08-04 10:03:08 UTC
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)
Comment 8 Antonin Nebuzelsky 2004-08-04 14:51:48 UTC
Verified. Thanks!