On Monday 30 November 2009 10:57:04 Peter Chen wrote:
> Hi,
>
> I meet one problem of OutOfMemoryError when I am running the
> Tomcat5.5.26. The OS is Solaris 10 sparc, and the JVM version is
> 1.5.0.12, and following is the detail of stack information.
>
> Nov 29, 2009 12:41:16 AM
>
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run
>
> SEVERE: Caught exception (java.lang.OutOfMemoryError: unable to create
> new native thread) executing
> org.apache.tomcat.util.net.leaderfollowerworkerthr...@958b36,

While Andre is right that system memory size and JVM parameters are important, 
this is not the usual OOM that heap space is full. Java is not able to create 
a OS level thread for a new Java thread. 

The most common cause seems to be that there is not enough memory to allocate 
for the thread stack, either because there is not enough system memory 
available, or the memory limit for the java process is reached.

You might be able to increase the memory limit for the process, if OS permits 
that and you  have enough physical memory. If the limit is indeed physical 
memory, cou can of course increase that or try to move other processes away 
from the machine.

Otherwise you need to provide java with enough memory for the new thread.

One approach is to reduce the stack size. There is  a -Xss switch to java, but 
I don't know Solaris, so I'm not sure this works or is sufficient. Possibly 
the OS has also to be configured to use/allow a smaller stack size.

Another approach is to reduce the other memory usage of the java process, by 
reducing heap (or perhaps permgen) size, so java can use more of its 
permitted memory for thread stacks instead of heap. See 
http://www.egilh.com/blog/archive/2006/06/09/2811.aspx and the links in the 
article.

A completely different cause might be that Solaris imposes a limit of the 
number of threads, regardless of the memory/stack size, per process. Perhaps 
a Solaris expert has more info.

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to