This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Patch: FYI: gcj3.1 status update
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: Andrew Haley <aph at cambridge dot redhat dot com>
- Cc: tromey at redhat dot com, Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>, java at gcc dot gnu dot org
- Date: Sat, 06 Apr 2002 14:50:44 +1200
- Subject: Re: Patch: FYI: gcj3.1 status update
- References: <87vgbpkdq9.fsf@creche.redhat.com> <yddadt1n13h.fsf@xayide.TechFak.Uni-Bielefeld.DE> <87hen88j9l.fsf@creche.redhat.com> <15522.10591.629932.889883@xayide.TechFak.Uni-Bielefeld.DE> <873cylmtgy.fsf@creche.redhat.com> <15522.23358.94998.805757@xayide.TechFak.Uni-Bielefeld.DE> <15523.5741.745762.853848@xayide.TechFak.Uni-Bielefeld.DE> <87bsd1wl3t.fsf@creche.redhat.com> <15531.21599.355771.833799@cuddles.cambridge.redhat.com> <15533.48639.496928.713137@cuddles.cambridge.redhat.com>
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.