Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

java.io.IOException: Too many open files

3 views
Skip to first unread message

Doug Smaglik

unread,
Oct 7, 1998, 3:00:00 AM10/7/98
to
I am writing a server application that should be able to
live indefinitely. Currently, after servicing seven client
requests I am getting an IOException: Too many open files.
The top of the stack trace is:

java.io.IOException: Too many open files
at java.lang.UNIXProcess.<init>(UNIXProcess.java)
at java.lang.Runtime.exec(Runtime.java)
at java.lang.Runtime.exec(Runtime.java)


The process that I am trying to invoke will runs an analysis
on an input file and subsequently creates an output file.

I assume that I am creating too many file objects and not
cleaning them appropriately. Has anyone seen this before?
Any insight / help would be greatly appreciated.

Thanks!

Doug Smaglik

vcard.vcf

R. Maitland Baxter

unread,
Oct 7, 1998, 3:00:00 AM10/7/98
to
I can't help too much but I'm pretty sure that java imposes a limit on
file descriptors and that exception is thrown when you get to
something like 54(?) open files. I'm sure someone will be along to
point out the exact number shortly. Make sure you are closing files
when you are done with them with the .close() method.


On Wed, 07 Oct 1998 14:44:02 GMT, Doug Smaglik
<dsma...@netgenics.com> wrote:

>This is a multi-part message in MIME format.
>--------------A69DEDBE67B2E0C334CD4CF6
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit


Posted by Robert Maitland Baxter who was hired under Operation Bootstrap.
ro...@ita.cph.dk
"Yes, I _am_ interested in long-distance savings. _Very_ interested!"

Dominique Brazziel

unread,
Oct 7, 1998, 3:00:00 AM10/7/98
to
DOS Files= param in CONFIG.SYS maybe?

Erwin Bolwit

unread,
Oct 8, 1998, 3:00:00 AM10/8/98
to
"R. Maitland Baxter" wrote:
>
> I can't help too much but I'm pretty sure that java imposes a limit on
> file descriptors and that exception is thrown when you get to
> something like 54(?) open files. I'm sure someone will be along to
> point out the exact number shortly. Make sure you are closing files
> when you are done with them with the .close() method.

It depends on your system configuration.

On unix/tcsh:

limit descriptors <some very big number>

... before starting your application.

On solaris (at least pre 2.6) you need to modify
some kernel parameters to get it really high
(>256).

E.

Grant Gainey

unread,
Oct 8, 1998, 3:00:00 AM10/8/98
to
R. Maitland Baxter wrote:
>
> I can't help too much but I'm pretty sure that java imposes a limit on
> file descriptors and that exception is thrown when you get to
> something like 54(?) open files. I'm sure someone will be along to
> point out the exact number shortly. Make sure you are closing files
> when you are done with them with the .close() method.

No - Java imposes no such limits. The operating system, however,
may. In Unix, you need to do a "man ulimit", and set the
number of open files to a larger number. I don't recall what the
equivalent setting is in Windows, sorry.

Note that closing files when you're done with them is good advice
regardless...

Grant
_________________________________________________________________________
Grant Gainey gga...@widget.com
The Widget Workshop http://www.widget.com/ (919)829-1933
"In theory, there is no difference between theory and practice.
In practice, there is no relationship between theory and practice."

0 new messages