Re: Too-many-files errors on OS X - Mailing list pgsql-hackers

From Kevin Brown
Subject Re: Too-many-files errors on OS X
Date
Msg-id 20040223005933.GK2608@filer
Whole thread Raw
In response to Re: Too-many-files errors on OS X  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Too-many-files errors on OS X  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Too-many-files errors on OS X  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Kevin Brown <kevin@sysexperts.com> writes:
> > I originally thought that each shared library that was loaded would eat
> > a file descriptor (since I thought it would be implemented via mmap())
> > but that doesn't seem to be the case, at least under Linux
>
> Hmm.  This may be OS-specific.  The shlibs certainly show up in the
> output of lsof in every variant I've checked, but do they count against
> your open-file limit?

It seems not, for both shared libraries that are linked in at startup
time by the dynamic linker and shared libraries that are explicitly
opened via dlopen().  This seems to be true for Linux and Solaris (I
wasn't able to test on HP-UX, and AIX yields a strange "bad file number"
error that I've yet to track down).

Attached is the test program I used.  It takes as its arguments a list
of files to hand to dlopen(), and will show how many files it was able
to open before and after running a batch of dlopen() commands.


--
Kevin Brown                          kevin@sysexperts.com

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] Mac OS X, PostgreSQL, PL/Tcl
Next
From: Tom Lane
Date:
Subject: Re: Too-many-files errors on OS X