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 41445 - Search on disk root seems to be leaking memory even when no matching item was found
Summary: Search on disk root seems to be leaking memory even when no matching item was...
Status: RESOLVED DUPLICATE of bug 42992
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: issues@utilities
Depends on:
Reported: 2004-03-28 18:03 UTC by David Konecny
Modified: 2004-08-13 12:12 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description David Konecny 2004-03-28 18:03:42 UTC
Root of disks are now mounted and search often end
up in OutOfMemory exception. Please look at it and
evaluate. I do not have concete data at hand, but
this might be potentially serious DEFECT!
Comment 1 Tomas Pavek 2004-03-29 14:00:01 UTC
Isn't this just solved in the issue 39584 - by doing the search only
through the opened projects? Reducing the scope this way should avoid
the OutOfMemoryError...
Comment 2 David Konecny 2004-03-29 16:39:37 UTC
Maybe. But OOME should not be thrown in any case.
Comment 3 Tomas Pavek 2004-03-29 16:44:12 UTC
There's no appropriate way to avoid throwing OOME. You can just make
the user to work with appropriate set of data so it does not happen in
the common use cases. That's what the mentioned issue is about.

*** This issue has been marked as a duplicate of 39584 ***
Comment 4 Jesse Glick 2004-03-29 17:08:27 UTC
Don't really agree with this evaluation - regardless of the size of
the data set, searching should require a constant working set (should
not be holding refs to files it is not searching on), so OOMEs should
not result; if they do there is a bug somewhere (not sure where). But
up to you and QA...
Comment 5 Tomas Pavek 2004-03-29 17:37:24 UTC
I was not quite correct. Reducing the scope, i.e. the set of searched
data, is not the cleanest way (though it would work too in this case).
The basic problem seems to be not in the amount of data searched
through, but in that how the results are managed. If you keep *all*
the search results you may end up with OOME if there is really lots of
results. We could e.g. try to limit the results to a certain number of
files, do incremental search, etc. We can certainly tune the searching
to keep the memory consumption scaling an in reasonable absolute
limits. But generally certain amount of memory will always be needed -
which may cause OOME.
Comment 6 David Konecny 2004-03-30 09:17:22 UTC
I tried following: 
* Windows -> All Files
* right click D:\ drive -> Find
* enter some Substring which does not exist (so that there will not be
any hit)

Now it took some time on my WinXP notebook, but at the beginning the
Memory toolbar shows something like 14/24MB. After some time it gets
up to 88/96MB and forcing garbage collection does not make it any
smaller. The system gets sort of unstable - cannot stop searching,
etc. I killed IDE at this point. Weird. And all this happened even
when there was no one file matching search criteria. Who consumed the
memory? Looks like clear defect.
Comment 7 Marian Petras 2004-03-30 15:19:49 UTC
David, I do not understand this issue. Is it a report of a defect or
you simply want us to do some task (evaluation)? Please choose one and
modify the status and/or summary appropriately.

Please consider bugs #40504 (P1 - memory leak in search) and #19484
(P3 - OOME when performing search on larger FS).

Was the fix of bug #40504 integrated in the build you encountered the
problems with?
Comment 8 David Konecny 2004-03-31 08:20:46 UTC
This issue mutated from general task to evaluate search performance
(because disk roots are mounted now) to concrete defect.

The defects you mentioned are not relevant to this I guess because in
scenario I described I get no one item was found yet memory
consumption increased a lot. And anyway I was using latest build.
Comment 9 Marian Petras 2004-03-31 10:06:42 UTC
OK, accepted.
Comment 10 David Konecny 2004-04-29 09:06:44 UTC
Any progress on this? Is not issue 19484 duplicate of this one?
Comment 11 _ pkuzel 2004-05-11 14:31:30 UTC
Duplicates issue #42992 a MFS leak.

*** This issue has been marked as a duplicate of 42992 ***