This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Re: Try to gc when we run out of file handles
- To: tromey at cygnus dot com
- Subject: Re: Try to gc when we run out of file handles
- From: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>
- Date: 26 Jun 2000 17:18:00 -0000
- CC: java-patches at sourceware dot cygnus dot com
> Date: Mon, 26 Jun 2000 10:08:43 -0700 (PDT)
> From: Tom Tromey <tromey@cygnus.com>
>
> Andrew> There's a memory and file descriptor leak in createTempFile().
> Andrew> This fixes it, I think.
>
> I think you can just call "desc.close()" at the end of createTempFile.
Yeah, I think so. It seemed to me that the author was keeping the
desc open for some reason, so I was just being careful.
> FYI there is a PR on this, so include the PR info in the ChangeLog
> entry.
Oh, right. I never saw the PR.
> Andrew> * java/io/natFileDescriptorPosix.cc (open): Run gc when open()
> Andrew> fails due to too many open files.
>
> You probably want to call System.runFinalization after the GC.
> This isn't a guarantee (for some collectors running the GC doesn't
> even make sense), but it is still better than what we have now.
Well, anything involving fixed size resource pools is bound to be
somewhat system + gc dependent, I guess. At least this gives us a
chance to continue.
Andrew.