Enterprise Integration Zone is brought to you in partnership with:

I'm Singaram Subramanian, and I work with CSC India as a Software Developer. My blog is an attempt to share my learnings with all (mainly, for those who desperately mine google finding ways to solve problems, fix issues, learn about a Java/Open source software, or deciding on tough choices etc. during software development as I do). Singaram is a DZone MVB and is not an employee of DZone and has posted 36 posts at DZone. You can read more from them at their website. View Full User Profile

Apache ActiveMQ – How to resolve java.io.IOException: Too many open files exception?

05.21.2013
| 5935 views |
  • submit to reddit

I have worked on ActiveMQ for quite a while, and there’s one annoying exception that I see all the time – java.io.IOException: Too many open files – which we see time to time.

[localhost:61613] ERROR TransportConnector – Could not accept connection : Too many open files
[or@0.0.0.0:8161] WARN  log – EXCEPTION
java.io.IOException: Too many open files
at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:145)
at org.mortbay.jetty.nio.SelectChannelConnector$1.acceptChannel(SelectChannelConnector.java:75)
at org.mortbay.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:475)
at org.mortbay.io.nio.SelectorManager.doSelect(SelectorManager.java:166)
at org.mortbay.jetty.nio.SelectChannelConnector.accept(SelectChannelConnector.java:124)
at org.mortbay.jetty.AbstractConnector$Acceptor.run(AbstractConnector.java:537)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

Have spent some time gooling about this error and got a rough idea on what this error is all about, what we can do to identify the issue, and (possibly!) fix it :)

I’ll need some more time to write what I’m doing to solve it, and btw, you can find the links that were helpful to me:

1. ActiveMQ 5.1.0 runs out of file descriptors with lots of ‘CLOSE_WAIT’ socketshttps://issues.apache.org/jira/browse/AMQ-1739
2. ActiveMQ forum:http://activemq.2283324.n4.nabble.com/too-many-open-files-td2364996.html

Published at DZone with permission of Singaram Subramanian, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)