[zeromq-dev] Too many open files (signaler.cpp:330)

Martin Lucina martin at lucina.net
Thu Jan 5 02:01:18 CET 2012


On Wed, 04 Jan 2012 22:29:46 +0100
Martin Sustrik <sustrik at 250bpm.com> wrote:

> On 04/01/12 14:55, Chuck Remes wrote:
> 
> > What elements should I printf? Is the +sv+ variable important? What
> > values should it have (or not have)?
> 
> I believe there's nothing to print there except of fact that a 
> socketpair was created.
> 
> > Is there a way to print the total number of FDs in use at that point
> > in time? That is, can I add a counter ivar to the class and increment
> > it in that function?
> 
> I am not aware of such a function. However, it's possible there's a tool 
> on OSX that provides you with the number interactively.

For the total number of fds in use in the system, you could try
something like 'lsof'.

If you just need the total number used in that particular process,
then fds are just integers numbered from 0 up, so printing whatever is
the last one you get from socket() or similar will tell you how many
that process is using up till now.

-mato 
-- 
Martin Lucina <martin at lucina.net>



More information about the zeromq-dev mailing list