classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] handle case with lots of unreferenced objects that has fd's


From: Noa Resare
Subject: [cp-patches] handle case with lots of unreferenced objects that has fd's open
Date: Fri, 05 Nov 2004 16:09:26 +0100

A while ago the mauve test java/nio/channels/FileChannel/manyopen.java
was discussed on the mauve list. It opens a lot of objects using file
descriptors without preserving references to them, and sees if the jvm
is smart enough to finalize the objects when needed to open new fd's.

The attached patch runs System.gc() and System.runFinalization() if the
native open() call returns FileNotFoundException (as it does when there
are too many open files for the open(2) to succeed) and tries to open
the file again.

Of course this is not guaranteed to work on every conceivable jvm that
uses classpath, but on the other hand it does little harm other than
delay the throwing of FileNotFoundException a little bit.

The patch is tested with jamvm and kaffe and fixes the manyopen mauve
test referenced above on both.

/noa

Attachment: classpath-filechannel.patch
Description: Text Data

Attachment: signature.asc
Description: Detta är en digitalt signerad meddelandedel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]