Summary: | OutOfMemoryError: unable to create new native thread - and tomcat "hangs" | ||
---|---|---|---|
Product: | Tomcat 5 | Reporter: | Erik Pischel <erik.pischel> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | frederic.bages |
Priority: | P3 | ||
Version: | 5.0.19 | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | Linux |
Description
Erik Pischel
2004-09-26 16:48:02 UTC
You can patch your Tomcat to do that if you want to, but the main problem is that the VM is not in a stable state once an OOM error occurs (and besides, the VM will likely be spending all its time doing full GCs). Finding the source of the OOM would be better for you, IMO. This has nothing to do with running out of heap. It is about running native memory : every thread uses some native memory (mainly for stack trace). Even if there is plenty of heap, native memory area might be to small to create a new thread. So JVM should run stable if no other threads are created. ups, I meant "it is about running out of native memory" and native memory is mainly used for thread stacks (not traces). As for the proposed fix: on the other hand, the ThreadPool's contract might be about not throwing an exception when failing to create a new thread but tolerating this and queuing the runIt request for an existing thread to execute. No, I disagree with your proposed fix. The ability to work when your configuration is bad enough that you can't create a new thread is not something I want to even try to do. Make sure your configuration (of the heap, of the stack size, and of the thread pool properties) works along with your hardware and operating system. *** Bug 32262 has been marked as a duplicate of this bug. *** This is obviously a problem with at least not logging the problem! eBay gets OOM all the time in the application stack that are recoverable. This behavior is unacceptable for an enterprise server. This is obviously a problem with at least not logging the problem! eBay gets OOM all the time in the application stack that are recoverable. This behavior is unacceptable for an enterprise server. We had the same issue (jdk1.5, tomcat 5.0.25) and it was solved by giving the vm more PermGenSpace. |