Hi Christopher. On Tue, Mar 10, 2009 at 11:04:43AM -0400, Christopher Schultz wrote: > > I > > would like to know if they are useful and if not how to lessen their > > number. > > You should do a thread dump (send a SIG 3 > to your process and watch stdout)
Thank you, that has made much clearer. > JVM-created threads (you can't eliminate these): > > "main" - runs the main program > "Reference Handler" - GC thread > "Finalizer" - GC thread > "Low Memory Detector" - GC thread > "CompilerThread0" - JIT thread > "Signal Dispatcher" - Handles signals > > Tomcat-created threads: > "ContainerBackgroundProcessor[StandardEngine[Catalina]]" > "TP-Monitor" - monitors the request handler thread pool > "TP-Processor[n]" - these are the request handlers. > You have configured your TC instance to have between > 2 and 10 of them. I wouldn't be surprised to find > that you have 5 TP-Processor threads. I have 12. > My thread dump contained 5 JVM threads + 14 Tomcat threads + 1 MySQL > thread = 20 threads. You have 27, and you didn't tell us a thing about > what your application does. "Default Tomcat home page" and Server-status/Tomcat Manager applications :) > > <Connector address="123.123.123.123" port="50002" protocol="HTTP/1.1" > > connectionTimeout="20000" maxThreads="10" minSpareThreads="2" > > maxSpareThreads="5" /> > > This is the only information you gave us that could help determine what > those threads are. If you take a thread dump and re-post, we might be > able to help. Full thread dump Java HotSpot(TM) 64-Bit Server VM (10.0-b22 mixed mode): "http-123.123.123.123-50002-Acceptor-0" daemon prio=10 tid=0x00002aaac4a5e000 nid=0x348b runnable [0x000000004143c000..0x000000 004143cd90] java.lang.Thread.State: RUNNABLE ... [full dump in attach] $ grep -c tid catalina.out 19 According to the written above everything is clear in the dump. Thank you so much for your help. But i've got one question left, can I set idle timeout for the thread TP-Processor, after which they will die? -- BRGDS. Alexey Vlasov.
Full thread dump Java HotSpot(TM) 64-Bit Server VM (10.0-b22 mixed mode): "http-123.123.123.123-50002-Acceptor-0" daemon prio=10 tid=0x00002aaac4a5e000 nid=0x348b runnable [0x000000004143c000..0x000000 004143cd90] java.lang.Thread.State: RUNNABLE at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384) - locked <0x00002aaac0a902e8> (a java.net.SocksSocketImpl) at java.net.ServerSocket.implAccept(ServerSocket.java:453) at java.net.ServerSocket.accept(ServerSocket.java:421) at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(Unknown Source) at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(Unknown Source) at java.lang.Thread.run(Thread.java:619) "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon prio=10 tid=0x00002aaac4a5d800 nid=0x348a waiting on condition [0x000000004133b000..0x000000004133bd10] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(Unknown Source) at java.lang.Thread.run(Thread.java:619) "Low Memory Detector" daemon prio=10 tid=0x00002aaac8023400 nid=0x3455 runnable [0x0000000000000000..0x0000000000000000] java.lang.Thread.State: RUNNABLE "CompilerThread1" daemon prio=10 tid=0x00002aaac8020800 nid=0x3454 waiting on condition [0x0000000000000000..0x00000000410373e0] java.lang.Thread.State: RUNNABLE "CompilerThread0" daemon prio=10 tid=0x00002aaac801f000 nid=0x3453 waiting on condition [0x0000000000000000..0x0000000040f36360] java.lang.Thread.State: RUNNABLE "Signal Dispatcher" daemon prio=10 tid=0x00002aaac801dc00 nid=0x3452 waiting on condition [0x0000000000000000..0x0000000000000000] java.lang.Thread.State: RUNNABLE "Finalizer" daemon prio=10 tid=0x00002aaac42bac00 nid=0x344d in Object.wait() [0x0000000040d35000..0x0000000040d35c10] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00002aaac08e0be0> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116) - locked <0x00002aaac08e0be0> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159) "Reference Handler" daemon prio=10 tid=0x00002aaac42b9800 nid=0x344c in Object.wait() [0x0000000040c34000..0x0000000040c34d90] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00002aaac08e01b0> (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Object.java:485) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116) - locked <0x00002aaac08e01b0> (a java.lang.ref.Reference$Lock) "main" prio=10 tid=0x0000000040113400 nid=0x3442 runnable [0x0000000040229000..0x000000004022aed0] java.lang.Thread.State: RUNNABLE at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384) - locked <0x00002aaabe937cf8> (a java.net.SocksSocketImpl) at java.net.ServerSocket.implAccept(ServerSocket.java:453) at java.net.ServerSocket.accept(ServerSocket.java:421) at org.apache.catalina.core.StandardServer.await(Unknown Source) at org.apache.catalina.startup.Catalina.await(Unknown Source) at org.apache.catalina.startup.Catalina.start(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Unknown Source) at org.apache.catalina.startup.Bootstrap.main(Unknown Source) "VM Thread" prio=10 tid=0x00002aaac42b4400 nid=0x344b runnable "GC task thread#0 (ParallelGC)" prio=10 tid=0x000000004011d800 nid=0x3443 runnable "GC task thread#1 (ParallelGC)" prio=10 tid=0x000000004011ec00 nid=0x3444 runnable "GC task thread#2 (ParallelGC)" prio=10 tid=0x000000004011fc00 nid=0x3445 runnable "GC task thread#3 (ParallelGC)" prio=10 tid=0x0000000040121000 nid=0x3446 runnable "GC task thread#4 (ParallelGC)" prio=10 tid=0x0000000040122400 nid=0x3447 runnable "GC task thread#5 (ParallelGC)" prio=10 tid=0x0000000040123800 nid=0x3448 runnable "GC task thread#6 (ParallelGC)" prio=10 tid=0x0000000040124c00 nid=0x3449 runnable "GC task thread#7 (ParallelGC)" prio=10 tid=0x0000000040126000 nid=0x344a runnable "VM Periodic Task Thread" prio=10 tid=0x00002aaac8025800 nid=0x3456 waiting on condition JNI global references: 1115 Heap PSYoungGen total 38208K, used 5503K [0x00002aaabe8e0000, 0x00002aaac1380000, 0x00002aaac3e30000) eden space 32768K, 6% used [0x00002aaabe8e0000,0x00002aaabeacba10,0x00002aaac08e0000) from space 5440K, 65% used [0x00002aaac08e0000,0x00002aaac0c54348,0x00002aaac0e30000) to space 5440K, 0% used [0x00002aaac0e30000,0x00002aaac0e30000,0x00002aaac1380000) PSOldGen total 87424K, used 0K [0x00002aaab3e30000, 0x00002aaab9390000, 0x00002aaabe8e0000) object space 87424K, 0% used [0x00002aaab3e30000,0x00002aaab3e30000,0x00002aaab9390000) PSPermGen total 21248K, used 10714K [0x00002aaaaea30000, 0x00002aaaafef0000, 0x00002aaab3e30000) object space 21248K, 50% used [0x00002aaaaea30000,0x00002aaaaf4a6948,0x00002aaaafef0000)
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org