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: -- (:)
From: Brian Hurt <bhurt@s...>
Subject: Re: [Caml-list] GC and file descriptors
On Fri, 14 Nov 2003, Eric Dahlman wrote:

> Another problem with doing this is that you are tying the rate at which 
> 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.
> It would be a bummer to have your program start failing because you used 
> a more memory efficient algorithm for some calculation.

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 
want to sit in tight loops opening descriptors to handle the out of 
descriptors case.  Java does #2, IIRC.

"Usenet is like a herd of performing elephants with diarrhea -- massive,
difficult to redirect, awe-inspiring, entertaining, and a source of
mind-boggling amounts of excrement when you least expect it."
                                - Gene Spafford 

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