Linux is the problem here. As you increase the mx JVM flag to be, the number of 
threads the java process can create decreases. This
not a tomcat thing but a java on linux thing. For example, setting mx to be 1028 
MBytes results in a thread ceiling of something
like 427, which is really low for any loaded tomcat server.

Unfortunately I don't have any solutions. You could switch to Unix, but that's hardly 
practical solution. I guess you could run two
tomcat instances on the same server and load-balance somehow, but that sounds tough 
too. I never solved this one myself.

-----Original Message-----
From: Ian McFarland [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 5:05 AM
To: Tomcat List
Cc: Ian McFarland
Subject: OutOfMemoryError under high load


Hello,

We're running into the following problem when our Tomcat instances are
under heavy load.

SEVERE: Caught exception executing
[EMAIL PROTECTED], terminating thread
java.lang.OutOfMemoryError: unable to create new native thread

The exception is always on thread creation, and correlates a condition
where the process count on the machine suddenly starts to ramp up from
a few hundred to a little above 1000 processes. (Load is fairly
constant during this time, and the condition always expresses itself at
right around the same level of traffic, about 6Mbps of throughput per
server.) There appears to be plenty of heap memory available when this
happens, so that coupled with the thread creation message leads us to
suspect that we're running into an OS tuning problem, instead of
specifically a problem with our app. (A radical rewrite of how our
domain objects are cached, and tuning of various caches to various
sizes, resulted in near identical performance, aside from large
differences in CPU utilization. This seems to further support this
conclusion.) Tuning maxProcessors and a variety of other parameters in
our app seems to have no discernible effect, neither beneficial nor
detrimental, beyond changes in CPU utilization, which always falls in a
band between 10 and 60%, depending on the tuning choices.

We're currently using Tomcat  4.1.13 under Linux 2.4.17 with Sun JDK
1.4.1_01. We've tuned all the obvious parameters, (ulimit -n and
/proc/sys/kernel/threads-max, for example,) or at least all the ones we
could think of. I think we're missing something obvious, and the OS is
not letting us spawn more threads. Anyone know what we're doing wrong?

Thanks in advance,
-Ian McFarland


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to