Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

EMFILE error

0 views
Skip to first unread message

Sasha

unread,
Sep 28, 2008, 8:38:38 PM9/28/08
to
I have a FastCGI app on Soalris 10 and after certain time I start
getting EMFILE (errno 24 - "too many file descriptors opened") error.
I open one file on disk using fopen and close it with fclose. I
verified that fclose is called for each file handle opened with fopen.
What can generate such error and how best to diagnose it? what means
"file descriptors' or solaris? Disk file handles, sockets? Is there
way to see from shell what file descriptors are opned by a process?

Gordon Burditt

unread,
Sep 28, 2008, 10:01:55 PM9/28/08
to
>I have a FastCGI app on Soalris 10 and after certain time I start
>getting EMFILE (errno 24 - "too many file descriptors opened") error.

EMFILE means "too many file descriptors opened" *IN YOUR PROCESS*.
ENFILE means "too many file descriptors opened" system-wide.

>I open one file on disk using fopen and close it with fclose. I
>verified that fclose is called for each file handle opened with fopen.

So how many files did you (try to) have open simultaneously?

>What can generate such error

Anything that opens a file or a file descriptor, including open(),
socket(), dup(), etc.

>and how best to diagnose it? what means
>"file descriptors' or solaris? Disk file handles, sockets?

Yes, and yes. Shared libraries might also occupy a file descriptor,
as might mapped memory.

>Is there
>way to see from shell what file descriptors are opned by a process?

'lsof' might prove useful. It's supposed to work on Solaris 9 and 10.

Barry Margolin

unread,
Sep 29, 2008, 1:36:19 AM9/29/08
to
In article <fIydnY8Bh-WOqn3V...@posted.internetamerica>,
gordon...@burditt.org (Gordon Burditt) wrote:

> >I have a FastCGI app on Soalris 10 and after certain time I start
> >getting EMFILE (errno 24 - "too many file descriptors opened") error.

...


> >Is there
> >way to see from shell what file descriptors are opned by a process?
>
> 'lsof' might prove useful. It's supposed to work on Solaris 9 and 10.

Truss would also be useful, you can see all the opens and closes, and
ensure that they match up.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***

Andrew Gabriel

unread,
Sep 30, 2008, 5:33:13 PM9/30/08
to
In article <fIydnY8Bh-WOqn3V...@posted.internetamerica>,

pfiles is the native Solaris command.

--
Andrew Gabriel
[email address is not usable -- followup in the newsgroup]

0 new messages