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 33856 - Out of IO descriptors after multiple Find in Files
Summary: Out of IO descriptors after multiple Find in Files
Alias: None
Product: utilities
Classification: Unclassified
Component: Search (show other bugs)
Version: 3.x
Hardware: All All
: P2 blocker (vote)
Assignee: Marian Petras
: 35141 37156 (view as bug list)
Depends on:
Reported: 2003-05-23 11:04 UTC by tboerkel
Modified: 2003-12-11 14:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

ide.log (2.39 KB, text/plain)
2003-05-23 11:07 UTC, tboerkel
patch for NetBeans 3.5 (1.96 KB, patch)
2003-05-27 09:23 UTC, Marian Petras
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tboerkel 2003-05-23 11:04:11 UTC
After doing multiple Find in Files with RegEx,
NetBeans ran out of IO descriptors. Always used
"Modify search" and then clicked on the class only
in search results. NB showed a yellow search icon
in the source in the line with the searched text
(NB did show this icon for the first time - is
this a new feature? It does not do this on other
Result: Could not compile anymore
(StringIndexOutOfBoundsException: Bad file
descriptor) and could not save anymore
(IOException: Too many open files), although only
one source was open in the editor. Attaching ide.log.
Resolved by manually invoking GC from the Memory
Using NB 3.5 RC2 with JDK 1.4.2 beta.
Comment 1 tboerkel 2003-05-23 11:07:15 UTC
Created attachment 10401 [details]
Comment 2 pfelenda 2003-05-23 13:00:00 UTC
I try it to reproduce on Linux RH and jdk1.4.1_02.
This issue appeared only ontime. I'm using multiple search and regexpr.

My steps are :
1) Open Find dialog
2) Type class* to reg. exp. textfield in Full text tab
3) Type a* to reg. exp. texfield in Object name tab
4) Click Start search
5) I double clicked on some objects
6) Click Modify search in Results window
 ans try change settings in find dialog (go to step 2)

Changing priority to P3 because it is not 100% reproducible.

When you use reg. expr., then IDE highlight full rows with yellow
color. When you use search with substring then is highlited only found

What is your reg. expresion ?
Comment 3 tboerkel 2003-05-23 13:47:34 UTC
Thanks for the info.
This is the RegEx:
Comment 4 Marian Petras 2003-05-26 14:50:56 UTC
I found the way how to reproduce this bug.

(Solaris 8 @ Sparc, JDK 1.4.1_01, NB 3.5 RC 2).
1) Start NetBeans.
2) Mount directory containing sources of module "openide".
3) Choose "Find..." from (a pop-up menu of the explorer node
   representing) the directory.
4) Enter "aha" into the Substring field and press OK.
5) Close the IDE.
An exception claiming "too many open files" is written to ide.log and
an error message reporting several exceptions having the same cause is
displayed on the screen.

You may need to repeat steps 3)-4) several times to reproduce the bug.
On Solaris 8, it is enough to perform the steps just once since the
limit for number of concurrently open files is low (1000 or less). On
other platforms, the limit may be higher (several thousands) so it is
necessary to perform the search several times to see syndroms of the bug.
Comment 5 Marian Petras 2003-05-26 15:00:46 UTC
The cause of this bug is that files being searched are not closed
after search is finished on them so that every search increases number
of currently open files. Because number of currently open files is
limited in operating systems (OS), once the limit is reached, the OS
does not allow to open any more files to the IDE.
    There are various symptoms of the bug. The Search function may not
find all occurences of a string to be found. But even when the search
results window is closed, the whole IDE is affected because no more
files (e.g. configuration files) may be open, both for reading and
writing. Exceptions from various parts of the IDE may be thrown at
various times - it is common to these exceptions that they contain
statement "too many open files".
Comment 6 Marian Petras 2003-05-26 15:09:42 UTC
There is no good workaround for the bug. One may just defer the moment
the limit is reached by searching rather smaller trees of files
instead of searching large filesystems.
Comment 7 tboerkel 2003-05-26 15:15:36 UTC
After reading your recent comments, I would say this bug qualifies as
P1 for NB 3.5. It can cause very annoying and wrong behavior of NB.
Comment 8 Marian Petras 2003-05-26 16:47:40 UTC
Although the bug may cause strange behaviour of the under some
circumstances, it does not seem to have strong impact on most users.
This bug existed in the previous versions of the IDE (e.g. NB 3.4.1)
and was not reported until last Friday. Since it is very close to
release of NB 3.5, it is not desirable to make changes in NB 3.5 other
than functionality blockers.
Comment 9 Marian Petras 2003-05-26 18:37:22 UTC
Another workaround:
1) Enable the Memory toolbar of the main IDE window.
   (Right-click on an empty toolbar area of the window and check
    the Memory toolbar.)
2) After each search, click on the icon of a waste bin on the Memory
   toolbar and wait for 5 seconds.
Comment 10 Marian Petras 2003-05-27 09:23:43 UTC
Created attachment 10456 [details]
patch for NetBeans 3.5
Comment 11 Marian Petras 2003-05-27 14:15:27 UTC
The bug is fixed in the trunk.

I won't mark it fixed until it is decided whether the fix goes to NB
3.5 or not.
Comment 12 Jan Chalupa 2003-05-28 13:14:37 UTC
Too late for 3.5. Please mark as RESOLVED with TM=4.0
Comment 13 Marian Petras 2003-05-28 14:09:40 UTC
Fixed in NB 4.0, won't be fixed in NB 3.5.
Comment 14 pfelenda 2003-06-11 09:42:45 UTC
Verified in dev 200306110100.
Comment 15 Marian Petras 2003-07-30 11:43:08 UTC
*** Issue 35141 has been marked as a duplicate of this issue. ***
Comment 16 _ proxity 2003-10-27 13:25:03 UTC
Since there's a patch why don't you release it using the Update
Center? I think that's what the Update Center is for. I'm still
suffering from this bug using the current 3.5.1 release.
Comment 17 Antonin Nebuzelsky 2003-11-04 15:04:53 UTC
Fixed also in Nevada Patch 1 and in Arrow.
Comment 18 Marian Petras 2003-11-12 10:00:04 UTC
If anyone wants to post the patch to the hotfix update center, please
do so. The instructions are at
Source diff of the patch is available in attachment "bug33856.diff" of
this bug report.

I will try to do it in a week but I would appreciate anybody's help.
Comment 19 Marian Petras 2003-11-12 10:01:13 UTC
*** Issue 37156 has been marked as a duplicate of this issue. ***