title: How to handle java.net.SocketException: Too many open files
body: <p>Ours is a Struts2 java webapplication, using hibernate 3.5 ORM. When we perfom some parallel actions on the app, we are getting the below exceptions and the java process cpu utilization is at its max.</p>
  
  <pre><code>May 15, 2012 12:39:59 AM org.apache.catalina.core.ApplicationDispatcher invoke
  SEVERE: Servlet.service() for servlet jsp threw exception
  java.net.SocketException: Too many open files
  at java.net.PlainSocketImpl.socketAccept(Native Method)
      at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:408)
      at java.net.ServerSocket.implAccept(ServerSocket.java:462)
      at java.net.ServerSocket.accept(ServerSocket.java:430)
      at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:59)
      at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:210)
      at java.lang.Thread.run(Thread.java:662)
  </code></pre>
  
  <p>Please suggest us accordingly.</p>