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 57975 - Leaking file descriptors
Summary: Leaking file descriptors
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Matula
URL:
Keywords: PERFORMANCE
: 59918 62154 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-04-18 09:53 UTC by _ rkubacki
Modified: 2005-09-05 10:05 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
listing of file descriptors (185.18 KB, text/plain)
2005-04-18 09:54 UTC, _ rkubacki
Details
another listing (153.32 KB, text/plain)
2005-04-27 10:09 UTC, _ rkubacki
Details
first set of exceptions (3.84 KB, text/plain)
2005-04-27 10:12 UTC, _ rkubacki
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ rkubacki 2005-04-18 09:53:21 UTC
trunk build from Apr 18, JDK 1.5.0, Linux

I have a project setup with most of NetBeans projects + bunch of J2SE project,
after large update (Jesse's changes) my IDE fails to start because it cannot get
new file descriptors. The listing shows that there are many FDs held by deleted
MDR files.
Comment 1 _ rkubacki 2005-04-18 09:54:15 UTC
Created attachment 21695 [details]
listing of file descriptors
Comment 2 _ rkubacki 2005-04-27 10:09:26 UTC
Created attachment 21889 [details]
another listing
Comment 3 _ rkubacki 2005-04-27 10:12:41 UTC
Created attachment 21890 [details]
first set of exceptions
Comment 4 _ rkubacki 2005-04-27 10:15:03 UTC
I still have this problem. Once the mounting fails the IDE becomes unusable
because it tries to another attempts to mount the same file.
Comment 5 Antonin Nebuzelsky 2005-07-12 15:05:21 UTC
The problem with running out of file descriptors does not happen only if you
update the projects which you already had opened, but also if you simply start
with fresh userdir and open too many projects (nb_all/nbbuild project with all
the required projects). At classpath scanning all 1024 file descriptors are eaten.

MDR should not keep that many files open. It should close files and open them
only as needed.

Currently there is only one workaround - increase the number of allowed file
descriptors, see FAQ item at
http://wiki.java.net/bin/view/Netbeans/FaqOutOfFileDescriptors

Comment 6 Martin Matula 2005-07-12 17:59:09 UTC
*** Issue 59918 has been marked as a duplicate of this issue. ***
Comment 7 Jesse Glick 2005-07-12 22:58:40 UTC
Could close & reopen files, or try to merge contents of various files into
larger files, if that is possible. Currently there are three files created per
source root, which seems excessive. For example, my
$userdir/var/cache/mdrstorage/org-netbeans-java/0.66/ dir has 476 files in it
right now, and that's without having opened most NB modules as far as I can recall.
Comment 8 Martin Matula 2005-07-13 09:06:31 UTC
Yes, 3 permanent files per CP element, one temporary (the backup file) that is
only present during the IDE runtime (if the IDE is shutdown correctly). 2-3
files per extent are open during IDE run. Merging the files would be too
complicated at this point. We will try to keep the number of open files constant
and close/reopen files as needed.
Comment 9 Pavel Flaska 2005-08-11 16:36:33 UTC
*** Issue 62154 has been marked as a duplicate of this issue. ***
Comment 10 Pavel Flaska 2005-08-11 16:38:00 UTC
*** Issue 62154 has been marked as a duplicate of this issue. ***
Comment 11 Martin Matula 2005-08-18 16:13:16 UTC
I'll look at it.
Comment 12 Martin Matula 2005-08-20 00:13:54 UTC
Fixed. Number of FD's held by MDR is now limited to 200.

Checking in src/org/netbeans/mdr/persistence/btreeimpl/btreestorage/FileCache.java;
/cvs/mdr/src/org/netbeans/mdr/persistence/btreeimpl/btreestorage/FileCache.java,v
 <--  FileCache.java
new revision: 1.8; previous revision: 1.7
done
Checking in src/org/netbeans/mdr/persistence/btreeimpl/btreestorage/LogFile.java;
/cvs/mdr/src/org/netbeans/mdr/persistence/btreeimpl/btreestorage/LogFile.java,v
 <--  LogFile.java
new revision: 1.4; previous revision: 1.3
done
Comment 13 Antonin Nebuzelsky 2005-08-22 15:18:12 UTC
> Number of FD's held by MDR is now limited to 200.

Good. Anyway, why 200? Could this be set to something like 20 without
sacrificing performance? When you run tens of instances of Netbeans on a server
(e.g. SunRay server) it would save resources...