Tomcat JVM : Too many open files

i have an application running on tomcat application server.  After sometime of running it goes down with "Too many open files" error.

Here is the error.

Apr 14, 2009 6:22:53 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: accept: Too many open files
        at Method)
        at org.apache.catalina.core.StandardServer.await(
        at org.apache.catalina.startup.Catalina.await(
        at org.apache.catalina.startup.Catalina.start(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.apache.catalina.startup.Bootstrap.start(
        at org.apache.catalina.startup.Bootstrap.main(
Apr 14, 2009 6:22:53 PM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8082
Apr 14, 2009 6:22:53 PM acceptSocket
SEVERE: Endpoint ServerSocket[addr=,port=0,localport=8082] ignored exception: Too many open files Too many open files
        at Method)
        at org.apache.tomcat.util.threads.ThreadPool$
When I checked the server, I found more than 400 connection made to other server. which are in CLOSE_WAIT state.

java      31550 tomcat2  157u     IPv6 1472334157                 TCP> (CLOSE_WAIT)
java      31550 tomcat2  158u     IPv6 1472335993                 TCP> (CLOSE_WAIT)
java      31550 tomcat2  159u     IPv6 1472338064                 TCP> (CLOSE_WAIT)
java      31550 tomcat2  161u     IPv6 1472351704                 TCP> (CLOSE_WAIT)
java      31550 tomcat2  168u     IPv6 1472365912                 TCP> (CLOSE_WAIT)


I want to drill down the issue as which specific class or method is making this connection ? How can I start this troubleshooting ? Can someone please guide how to proceed ?
Who is Participating?
CptGigglesConnect With a Mentor Commented:
"I found more than 400 connection made to other server"

If both servers that are being used belong to you (Directly or Indirectly) I would tend to think that you could have some typos in your application/configuration that opens files but doesn't fully close them....

We had a problem with a JBoss server at my workplace that was doing something like this (JBoss runs an embedded Tomcat, so I would think they could be the same issue)
If however you think this is not an issue with the application, you can always increase the maximum open files configuration :


I also realize that most people would disagree with me but, sometimes a good old fashioned reboot solves a lot of lingering processes problems (Defunt Javas and such) which can do some crazy stuff to your machines.

Whats the OS here? In case of Unix, you can tighten the DOS attach
parameters. I have a feeling that the system is under DOS attack.
Prajal_SutariaAuthor Commented:
Its a Linux server. I do not understand where you are trying to point to ?
DOS, (Denial of Service) more here,

is a type of attack, where the user opens a lot of sockets in very short
time and flood the sockets. The legitimate users, will not be able to
connect to server.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.