Re: Too-many-files errors on OS X

From: Kevin Brown <kevin(at)sysexperts(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Too-many-files errors on OS X
Date: 2004-02-23 00:59:34
Message-ID: 20040223005933.GK2608@filer
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Kevin Brown <kevin(at)sysexperts(dot)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(at)sysexperts(dot)com

Attachment Content-Type Size
eatfds.c text/x-csrc 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2004-02-23 01:21:23 Re: dblink - custom datatypes NOW work :)
Previous Message Greg Patnude 2004-02-23 00:45:51 Re: User defined types -- Social Security number...