JVM Thread Control

I have a web application using Tomacat 5.0.28.

In catalina.bat for java i've given -Xxms256m -Xxmx512m.

When im running the application.. my java.exe is going upto 202mb.. thread count (in windows manager) is upto 700-800 (in 10 minutes).

and then my server goes slow and no request is accepted. My tomcat threadpool size is 300.

i dont know where to look for solution. pls give hints

[419 byte] By [Neo2001a] at [2007-11-26 14:27:13]
# 1
A threadpool number 300 is just to huge, how many CPUs you have on this box?
AjaySingh516a at 2007-7-8 2:20:44 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
right now i have only one cpu 2.8Ghz with 1 GB RAM
Neo2001a at 2007-7-8 2:20:44 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
On a single CPU box, at max only one thread will be on CPU. So, threadpool size of 300 is huge. I would recommend to make it 32
AjaySingh516a at 2007-7-8 2:20:44 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4

IMHO, you should investigate this issue instead of just reducing thread pool size to 32. Tomcat will create the additional thread if it does not find any free thread in pool. In your case it looks that threads are not getting freed quickly to handle new request. It could be because of number of reasons but some of them are:

1. Network congestion- Threads are trying hard to push the data so are not getting freed quickly

2. Application logic-Threads are spending considerable time in your application, so are not getting freed to handle new request.

Apart from above web-server might be getting the requests more that what it can handle, so availability of resources could be an issue. Web-Server's log can help you to further identify the actual reason.

Gurmit

Gurmit_Teotiaa at 2007-7-8 2:20:44 > top of Java-index,Java HotSpot Virtual Machine,Specifications...