Ya. I think I will have to re-analyze the code.
I have one doubt. Should the code I write be thread safe?
Following is the excerpt from the thread dump of different threads at
different states:
RUNNABLE
"http-80-37" daemon prio=6 tid=0x0b094400 nid=0x540 runnable
[0x0c5be000..0x0c5bfb94]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.getEntry(HashMap.java:347)
at java.util.HashMap.containsKey(HashMap.java:335)
/**This contains proprietery code **/
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)
Locked ownable synchronizers:
- None
WAITING
"http-80-33" daemon prio=6 tid=0x0b0e5800 nid=0xfe4 in Object.wait()
[0x0c47f000..0x0c47fd94]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x03a8d630> (a
org.apache.tomcat.util.net.JIoEndpoint$Worker)
at java.lang.Object.wait(Object.java:485)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.await(JIoEndpoint.java:414)
- locked <0x03a8d630> (a org.apache.tomcat.util.net.JIoEndpoint$Worker)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:440)
at java.lang.Thread.run(Thread.java:619)
Locked ownable synchronizers:
- None
What do you think?
-Anand
Stephen Caine wrote:
>
> Anand,
>
> As others will surely tell you, there is something amiss in your
> application that spawns threads. However, the maximum number of
> threads Tomcat will handle is somewhere about 2400. So, if you are
> getting an error at 1000 threads, look somewhere else.
>
> Stephen Caine
> Soft Breeze Systems, LLC
>
> On Apr 21, 2009, at 7:34 AM, connossieur wrote:
>
>>
>> Hi,
>>
>> I am using Tomcat 6.0.9 with the following server.xml config file:
>>
>> The Java version I am using is JDK1.6.0_06.
>> The problem is with the tomcat web app being used for a load test at
>> 200
>> messages/sec. The application runs well enough for half an hour but
>> after
>> that time, the CPU consumption is maximum and idle is 0. Also, there
>> are
>> more than 1000 threads even if I have configured the maximum threads
>> to be
>> 70 in the configuration. There is no problem in the application code.
>>
>> Where can be the problem in the Tomcat?
>> Thanks,
>> Anand
>> --
>> View this message in context:
>> http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23154175.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23156131.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]