Urgent! Tomcat4 closed giving Out of Memory Error.

qi zhang <[email protected]>
Newsgroups gmane.mail.archives.mail-archive
Message-ID <[email protected]>
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 work.

I built a system to run TPCW benchmark. One web and application server, 
with tomcat4.0 running, one database with mysql4.0 running on it and 
several client machines. The Jave version is j2sdk1.4.0_03. The system 
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. It appeared the error:

SEVERE: Caught exception executing 
org.apache.tomcat.util.net.TcpWorkerThread-NuMP4iMkatM@public.gmane.org, terminating thread
java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start(Native Method)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.<init>(ThreadPool.java:497)
        at 
org.apache.tomcat.util.threads.ThreadPool.openThreads(ThreadPool.java:387)
        at 
org.apache.tomcat.util.threads.ThreadPool.runIt(ThreadPool.java:226)
        at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:503)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
        at java.lang.Thread.run(Thread.java:536)


But my tomcat4 is running with option -server -Xmx1536M. (I also tried to 
change -Xss and -Xms, which didn't help.) And the actual memory 
utilization was less than 40%. (I have 2GB memory in this machine.)

I also changed 'ulimit -n 8192' and server.xml :

<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
    <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
               port="8080" minProcessors="5" maxProcessors="1750"
               enableLookups="true" redirectPort="8443"
               acceptCount="1000" debug="0" connectionTimeout="-1"
               useURIValidationHack="false" disableUploadTimeout="true" />
    <!-- Note : To disable connection timeouts, set connectionTimeout 
value  to -1 -->

Why this error happened? I was trying to use strace -f -p to trace the
system call, but it only gave me one line "accept(13, " and waited at that
point. Did anyone meet this problem before? Can I get some detailed error 
log besided catalina.out?

I really appreciate your kind help

Qi

-- 
Qi Zhang, Ph.D Student

Department of Computer Science,
College of William and Mary
P.O. Box 8795
Williamsburg, VA 23187-8795
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.