[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] handle case with lots of unreferenced objects that has
From: |
Noa Resare |
Subject: |
Re: [cp-patches] handle case with lots of unreferenced objects that has fd's open |
Date: |
Fri, 05 Nov 2004 17:25:26 +0100 |
fre 2004-11-05 klockan 16:09 +0100 skrev Noa Resare:
> 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.
>
Some further testing revealed that in a typical mauve test run the
finalization of the unreferenced objects with fd's open doesn't happen
with the added System.gc(); System.runFinalization().
I will investigate this further, but I think that there might be a good
idea to add a way to "force full gc/finalization" to the classpath jvm
interface for use cases when performance is not important compared to
getting a full finalization executed.
Stay tuned for some experimental code in a few hours :)
/noa
--
nuclear cia fbi spy password code president bomb
F3C4 AC90 B885 FE15 344B 4D05 220B 7662 A190 6F09
signature.asc
Description: Detta är en digitalt signerad meddelandedel