3 Replies Latest reply on Apr 3, 2009 6:41 PM by igain

    java.net.SocketException: Too many open files

    igain

      Hi,

      While load testing on Jboss 4.3 we are seeing one exception again and again.
      Initially when we saw this we increased our FD limit on Sun OS from 256 to 8000
      Even after setting max file descriptor 8000 in the Sun OS, it is giving same exception

      2009-04-03 00:49:38,777 ERROR [org.apache.tomcat.util.net.JIoEndpoint] Socket accept failed
      java.net.SocketException: Too many open files
       at java.net.PlainSocketImpl.socketAccept(Native Method)
       at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
       at java.net.ServerSocket.implAccept(ServerSocket.java:450)
       at java.net.ServerSocket.accept(ServerSocket.java:421)
       at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)
       at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310)
       at java.lang.Thread.run(Thread.java:595)
      


      What could be the possible reason for it ??
      Do we need to set FD limit in JVM as well ?

      We are using JDK1.5

      Thanks

        • 1. Re: java.net.SocketException: Too many open files
          peterj

          The number of files that can opened is entirely a function of the oS, not the JVM. However, the OS must have enough memory available to maintain the open file descriptors.

          Does Solaris have a utility that you can use to list the open files for a process, or at least report how many open files it has?

          • 2. Re: java.net.SocketException: Too many open files
            igain

            Thanks Peter,

            I am not sure about Solaris, I will have to check with solaris admin

            • 3. Re: java.net.SocketException: Too many open files
              igain

              Hi Peter,

              Even fater increasing the file decriptor limit to 65000, after 2 hrs we hit same error.

              We have been load testing with same number of users, however suddenly it has started giving "Too Many files open"

              We are using Java HotSpot(TM) Server VM (build 1.5.0_07-b03, mixed mode) , Sun OS 51.(sparc)

              and Jboss 4.3

              If i add -XX:+MaxFDLimit in JVM will it help?? Since it is solaris specific.