This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: FYI: gcj3.1 status update


Andrew Haley wrote:

>Better though to fix System.gc() so that it doesn't return until a
>grabage collection cycle has really happned.  There are deadlock
>problems with this, as I mentioned before.  I guess we could work
>around that problem with a fairly short timeout.
>

I don't think there is any deadlock danger with System.gc(), only 
runFinalization(). So, a solution might be to use the java.util.ref 
stuff to keep track of what FileDescriptor objects are reachable. If we 
run out of descriptors in open, it should call System.gc() (which can 
wait until a full collection has been completed, but not run finalizers) 
and then close the unreachable ones if we run out.

I do agree with Jeff that this is probibly not really that bad, however. 
Well written code that is opening a lot of files/sockets ought to call 
close() explicitly.

regards

Bryce.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]