From: Simon Marlow <[EMAIL PROTECTED]>
Subject: RE: openFile, process file table full
Date: Mon, 11 Sep 2000 02:10:59 -0700

> 
> > The following program:
> > 
> > module Main(main) where
> > main:: IO()
> > main = do {
> >         xs <- mapM readFile (take 1000 (repeat "tmp"));
> >         return ();
> > }
> > 
> > Results in the error:
> > 
> > Fail: resource exhausted
> > Action: openFile
> > Reason: process file table full tmp
> 
> That looks reasonable - there's usually some kind of limit on the number of
> files a process may have open, for example it's 1024 on our Linux box, and
> 64 on our Sparc box.  The limits come from various places: there's a soft
> limit which is setable by the user, a hard limit which can only be changed
> by root, and sometimes an upper limit imposed by bogus OS design :-)
> 
> Try typing 'ulimit -a' at your shell prompt.  Here's what I get on our Sparc
> box:
> 
> ~ > ulimit -a
> core file size (blocks)     unlimited
> data seg size (kbytes)      unlimited
> file size (blocks)          unlimited
> open files                  64
> pipe size (512 bytes)       10
> stack size (kbytes)         8192
> cpu time (seconds)          unlimited
> max user processes          3909
> virtual memory (kbytes)     unlimited

Arguably, readFile is too strict: why is the file opened, if there
aren't any characters needed. What is the motivation for opening the
file eagerly?

Marko

Reply via email to