tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Tomcat 6.0.20 "unable to create new native thread"
Date Wed, 19 May 2010 12:26:15 GMT
Hi all,

we have a problem with our tomcat 6.0.20 which throws occasionally the following exception:
java.lang.OutOfMemoryError: unable to create new native thread
Information about the system:
- Win2003 Server Standard Edition 32 bit
- Apache 2.2.13 with open SSL and mod_jk 1.2.28 for the communication with tomcat
- 2 instances of tomcat 6.0.20 on different ports. No redundancy / clustering. Each tomcat
serves different webapps.
- JDK 1.6.0_06

Only one tomcat throws the above noted exception.

- Tomcat 1 (with the problem)
   - MaxPermSize=256m
   - JvmMs 128 
   - JvmMx 768
   - maxThreads for HTTP: 450
   - maxThreads for jk: 3000

- Tomcat 2 (no problem yet)
   - MaxPermSize=256m
   - JvmMs 128 
   - JvmMx 512
   - MaxThreads for HTTP: 800
   - MaxThreads for jk: 450

When Tomcat 1 was throwing the exception the server status was showing the following:
   - mem Free  116 MB
   - mem Total 242 MB
   - mem Max   739 MB
   - current Thread jk    355
   - busy Thread    jk    333
   - current Thread HTTP  5
   - busy Thread    HTTP  3

   - all connections shown by netstat -an (not filtered): 4595
   - connections in state close_wait: 3152

The tomcat was not totally stuck. Already connected sessions seemed to have no problem, but
new sessions (new login) threw the exception and did could not be created. The Taskmanager
shows that all in all 1.39 GB of RAM are used - much below the 2GB Limit. 

On the other hand: Shouldn't  windows start to swap if the ram is full?

In which memory-area does windows handle the memory which is used for the threads? Is it shown
in the taskmanager?

Can the OS take the mem which is still unused by the JVM (memMax-memTotal) for handling threads
or is it reserved for the JVM after starting tomcat?

Due to problems with one of our webapps which sometimes does not close the threads completely
(they stuck in close_wait-state) we increased the max threads of windows:

maxUserPorts have been set to about 30k if i remember correctly.

Does anyone have an idea to get rid of the exception?

kind regards,
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen:

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

View raw message