tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: [Tomcat] [daemon] java.lang.OutOfMemoryError unable to create new native thread
Date Wed, 04 Feb 2009 18:08:04 GMT
Hash: SHA1


Steve Cohen wrote:
> One additional restriction I have is a security bureaucracy from hell.

You can use jmap from the command-line. That will give you a thread dump
which can help you see what all your threads are doing.

If you are using a system that uses POSIX threads, it might also help to
see what the output of 'ulimit -u' which will tell you the process limit
for your user. POSIX threads are essentially processes, so threads count
against your process limit.

The obvious answer is that you simply have too many threads being
created. There are a number of reasons you could be running out of
threads. Here are some:

1. Too many request processor threads configured in server.xml
   (see your <Connector> element). Inspect your configuration. You may
   have more connectors configured than necessary (I've seen
   configurations where both HTTP and AJP connectors are both enabled
   but only one is being used).

2. Too much file I/O. If you are using background threads to read/write
   files independently of the request processor thread, you might be
   creating too many of them. I recommend using a thread pool to
   schedule background jobs.

3. Timer threads. If you are using java.util.Timer, you may be creating
   more threads than you realize. Check your use of java.util.Timer and
   possibly use a thread pool for timed tasks.

4. Quartz, Quartz, Quartz (this is a job scheduler that generates a lot
   of questions on this list). Check any uses of Quartz.

- -chris
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message