Too many open files
See original GitHub issueI am having this issue after some hours of good working:
zmq.ZError$IOException: java.io.IOException: Too many open files at zmq.Signaler.make_fdpair(Signaler.java:87) at zmq.Signaler.<init>(Signaler.java:48) at zmq.Mailbox.<init>(Mailbox.java:55) at zmq.Ctx.<init>(Ctx.java:127) at zmq.ZMQ.zmq_ctx_new(ZMQ.java:225) at zmq.ZMQ.zmq_init(ZMQ.java:258) at org.jeromq.ZMQ$Context.<init>(ZMQ.java:173) at org.jeromq.ZMQ.context(ZMQ.java:155) at … (my files ) at java.lang.Thread.run(Thread.java:744) Caused by: java.io.IOException: Too many open files at sun.nio.ch.IOUtil.makePipe(Native Method) at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:42) at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:50) at java.nio.channels.Pipe.open(Pipe.java:150) at zmq.Signaler.make_fdpair(Signaler.java:85) … 11 more]]
I am running this java server in Glassfish. I don’t know if it is my fault or I should ask to system admin to check glassfish instance.
My ZMQ code:
ZMQ.Context context = ZMQ.context(1);
ZMQ.Socket sender = context.socket(ZMQ.PUSH);
sender.connect("tcp://127.0.0.1:8083");
sender.send(device, ZMQ.SNDMORE);
sender.send("obs", ZMQ.SNDMORE);
sender.send("["+message+"]", 0);
sender.close();
context.term();
I have this code inside a class created in a background thread. Each time I get a post to the server, I call new thread and create an instance of this class.
Issue Analytics
- State:
- Created 9 years ago
- Comments:20 (13 by maintainers)
what is your open files count from ‘ulimit -n’. If it is 1024 it would not be enough for hundreds of ZMQ sockets.
@aristodemos: a PR to fix those examples would be much appreciated!