tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Tulley" <>
Subject Re: Urgent! Tomcat4 closed giving Out of Memory Error
Date Mon, 08 Dec 2003 17:24:53 GMT
Look at the open files  - it is 9182.  That IS already pretty high, but
you may be hitting that limit since in Unix, everything is a file. 
Sockets, etc.

On Linux, is there a way in the JVM to tell the difference between
memory given to the new generation, old generation, and permanent
generation in the JVM?  There were users on this list posting weird
OutOfMemory errors last week that were doing class reloading, and the
permanent generation was filling up even though there was plenty of
space in the old and new gen.  Of course, I think these comments only
apply to a 1.4.x JVM.  Does your code do funky stuff with the
classloaders, or are you reloading your application in Tomcat's manager?
 (or changing web.xml, which would cause reloads??)  

Have you profiled your application to find any memory leaks?

>>> qizhang@CS.WM.EDU 12/6/03 11:45:27 AM >>>
I am using Linux2.4.20-smp. I think the limits for the entire system
not problem:
>cat /proc/sys/kernel/threads-max
>cat /proc/sys/fs/file-max
>cat /proc/sys/fs/file-nr
2231    1366    209708
>ulimit -a
core file size        (blocks, -c) 0
data seg size         (kbytes, -d) unlimited
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) unlimited
max memory size       (kbytes, -m) unlimited
open files                    (-n) 9182
pipe size          (512 bytes, -p) 8
stack size            (kbytes, -s) 8192
cpu time             (seconds, -t) unlimited
max user processes            (-u) 7168
virtual memory        (kbytes, -v) unlimited

But I can't find where the limits for each process/user are. One
found from google said PTHREAD_THREADS_MAX could be the max thread
per process. In my /usr/include/bits/local_lim.h, I have

/* The number of threads per process.  */
#define _POSIX_THREAD_THREADS_MAX       64
/* This is the value this implementation supports.  */
#define PTHREAD_THREADS_MAX     16384

16384 is large enough, I believe. Then what could be the reason of the


By the way, the "Out of Memory" error didn't appear all the time. 
Sometimes there was just no response without any error message. Do you

know where I can get more detailed bug files?

Thank you very much.


On Sat, 6 Dec 2003, Tim Funk wrote:

> When you get "java.lang.OutOfMemoryError: unable to create new native
> it means you are running into an operating system limit. You can give
the JVM 
> 1 Exabyte of memory and you'll still get this error.
> Look at the kernel parameters for your machine and the following
> 1) Threads allowable on the system
> 2) Threads run by a user
> 3) Threads run by a process
> 4) File handles per process
> 5) File handles per user
> Use your OS manual or Google to tweak these parameters.
> -Tim
> qi zhang wrote:
> > Hi,
> > 
> > I have stunk on this problem for almost 2 weeks. :-( 
> > In these two weeks, I have tried many methods, but it still doesn't
> > 
> > I built a system to run TPCW benchmark. One web and application
> > with tomcat4.0 running, one database with mysql4.0 running on it
> > several client machines. The Jave version is j2sdk1.4.0_03. The
> > worked perfect under light load. But when the number of clients 
> > exceeded some number (like 600), the tomcat4 didn't work anymore.
> > I checked catalina.out. Sometimes no error message appear, while in
> > time it appeared the error:
> > 
> > SEVERE: Caught exception executing 
> >, terminating
> > java.lang.OutOfMemoryError: unable to create new native thread
> >         at java.lang.Thread.start(Native Method)
> >         at 
> >
> >         at 
> To unsubscribe, e-mail: 
> For additional commands, e-mail:


Qi Zhang, Ph.D Student

Department of Computer Science,
College of William and Mary
P.O. Box 8795
Williamsburg, VA 23187-8795

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

Jeff Tulley  (
Novell, Inc., The Leading Provider of Net Business Solutions

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

View raw message