Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] GC and file descriptors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-14 (21:36)
From: John J Lee <jjl@p...>
Subject: Re: [Caml-list] GC and file descriptors
On Fri, 14 Nov 2003, Brian Hurt wrote:

> On Fri, 14 Nov 2003, Eric Dahlman wrote:
> > file descriptors are closed to the GC profile of your program.  If you
> > only have 10's or 100's of file descriptors available it would be very
> > easy to use them all up in a tight loop which did not allocate much memory.
> This is easy enough to work around- have the file open try a GC if the
> file open fails.  Alternatively, you could simply require programs that

File descriptors can be a globally limited resource, though, can't they?
If your program uses them all up, other programs can't get one either.

Also, does O'Caml *always* GC objects?  If they're un-GC-ed at time of
program exit, will they still be GC-ed, or does O'Caml just leave it to
the OS to clean up in that case?  If it leaves it to the OS, files could
be left open, and I'm not sure it's guaranteed that having files open for
writing at program exit won't cause data loss.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: