tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joao Filipe Placido <joao-f-plac...@ptinovacao.pt>
Subject RE: HELP, PLEASE! Tomcat creates too many threads!
Date Fri, 10 Jan 2003 17:28:57 GMT
Well, now I'm not using SingleThreadModel and the problem remains.
The threads are only killed when I restart tomcat and a few are created at
every request.
Here's a thread dump. The threads "Thread-x" keep appearing for every
request and they seem to be locked at some Object.wait() method. Is there
anyway of finding out where this Object.wait() is? (some jar I'm using...?)
It's certainly not in my servlet's code... How can I further debug this
situation?

Any help appreciated.

João Filipe Plácido

----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
--------
Full thread dump Java HotSpot(TM) Client VM (1.4.1_01-b01 mixed mode):

"Thread-18" daemon prio=1 tid=0x0x8524228 nid=0x41b2 in Object.wait()
[4ea0b000..4ea0b840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x45004ab0> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:426)
        at java.util.TimerThread.mainLoop(Timer.java:403)
        - locked <0x45004ab0> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:382)

"Thread-17" daemon prio=1 tid=0x0x810d5e0 nid=0x41b0 in Object.wait()
[4e98a000..4e98a840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44fe5510> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:426)
        at java.util.TimerThread.mainLoop(Timer.java:403)
        - locked <0x44fe5510> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:382)

"Thread-16" daemon prio=1 tid=0x0x8705ef8 nid=0x41ad in Object.wait()
[4e909000..4e909840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44fa7be0> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:426)
        at java.util.TimerThread.mainLoop(Timer.java:403)
        - locked <0x44fa7be0> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:382)

"Thread-15" daemon prio=1 tid=0x0x8705c18 nid=0x41ac in Object.wait()
[4e888000..4e888840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44fa7c40> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:426)
        at java.util.TimerThread.mainLoop(Timer.java:403)
        - locked <0x44fa7c40> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:382)

"Thread-14" daemon prio=1 tid=0x0x83a3a28 nid=0x41a7 in Object.wait()
[4e786000..4e786840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44f5e370> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:426)
        at java.util.TimerThread.mainLoop(Timer.java:403)
        - locked <0x44f5e370> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:382)

"Thread-13" daemon prio=1 tid=0x0x8443918 nid=0x41a6 in Object.wait()
[4e684000..4e684840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44f5e3d0> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:426)
        at java.util.TimerThread.mainLoop(Timer.java:403)
        - locked <0x44f5e3d0> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:382)

"Thread-12" daemon prio=1 tid=0x0x84003a8 nid=0x419a in Object.wait()
[4e705000..4e705840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44f18090> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:426)
        at java.util.TimerThread.mainLoop(Timer.java:403)
        - locked <0x44f18090> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:382)

"Thread-11" daemon prio=1 tid=0x0x84642b0 nid=0x4194 in Object.wait()
[4e603000..4e603840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44ef9728> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:426)
        at java.util.TimerThread.mainLoop(Timer.java:403)
        - locked <0x44ef9728> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:382)

"SocketTimeout" daemon prio=1 tid=0x0x83fd738 nid=0x418e waiting on
condition [4e582000..4e582840]
        at java.lang.Thread.sleep(Native Method)
        at HTTPClient.SocketTimeout.run(StreamDemultiplexor.java:917)

"Thread-10" daemon prio=1 tid=0x0x84fca80 nid=0x418c in Object.wait()
[4e501000..4e501840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44e73ed0> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:426)
        at java.util.TimerThread.mainLoop(Timer.java:403)
        - locked <0x44e73ed0> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:382)

"Thread-9" daemon prio=1 tid=0x0x84f2a88 nid=0x418b in Object.wait()
[4e480000..4e480840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44e61370> (a java.util.TaskQueue)
        at java.util.TimerThread.mainLoop(Timer.java:429)
        - locked <0x44e61370> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:382)

"Thread-8" daemon prio=1 tid=0x0x8442cb8 nid=0x4188 in Object.wait()
[4d95b000..4d95b840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44e43ea8> (a java.util.TaskQueue)
        at java.lang.Object.wait(Object.java:426)
        at java.util.TimerThread.mainLoop(Timer.java:403)
        - locked <0x44e43ea8> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:382)

"RMI TCP Accept-0" daemon prio=1 tid=0x0x8442780 nid=0x4187 runnable
[4d8da000..4d8da840]
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
        - locked <0x44e43f10> (a java.net.PlainSocketImpl)
        at java.net.ServerSocket.implAccept(ServerSocket.java:439)
        at java.net.ServerSocket.accept(ServerSocket.java:410)
        at sun.rmi.transport.tcp.TCPTransport.run(TCPTransport.java:334)
        at java.lang.Thread.run(Thread.java:536)

"Thread-7" daemon prio=1 tid=0x0x80dc9c0 nid=0x4186 waiting on condition
[4d859000..4d859840]
        at java.lang.Thread.sleep(Native Method)
        at
com.javaexchange.dbConnectionBroker.DbConnectionBroker.run(DbConnectionBroke
r.java:356)
        at java.lang.Thread.run(Thread.java:536)

"StandardManager[/logoutmmbox]" daemon prio=1 tid=0x0x838edd8 nid=0x416b
waiting on condition [4e234000..4e234840]
        at java.lang.Thread.sleep(Native Method)
        at org.apache.catalina.session.StandardManager.threadSleep(Unknown
Source)
        at org.apache.catalina.session.StandardManager.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)

"MonitorRunnable" daemon prio=1 tid=0x0x8392da8 nid=0x416a in Object.wait()
[4dff1000..4dff1840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44a912e0> (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
        at
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.jav
a:423)
        - locked <0x44a912e0> (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
        at java.lang.Thread.run(Thread.java:536)

"Thread-5" daemon prio=1 tid=0x0x8391760 nid=0x4169 runnable
[4df70000..4df70840]
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
        - locked <0x4480d038> (a java.net.PlainSocketImpl)
        at java.net.ServerSocket.implAccept(ServerSocket.java:439)
        at java.net.ServerSocket.accept(ServerSocket.java:410)
        at
org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultSe
rverSocketFactory.java:107)
        at
org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java
:335)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:483)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:533)
        at java.lang.Thread.run(Thread.java:536)

"Thread-4" daemon prio=1 tid=0x0x8390aa0 nid=0x4168 in Object.wait()
[4deef000..4deef840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44a66a50> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
        at java.lang.Object.wait(Object.java:426)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:512)
        - locked <0x44a66a50> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
        at java.lang.Thread.run(Thread.java:536)

"Thread-3" daemon prio=1 tid=0x0x838fe80 nid=0x4167 in Object.wait()
[4de6e000..4de6e840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44a66ab8> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
        at java.lang.Object.wait(Object.java:426)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:512)
        - locked <0x44a66ab8> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
        at java.lang.Thread.run(Thread.java:536)

"Thread-2" daemon prio=1 tid=0x0x838f350 nid=0x4166 in Object.wait()
[4dded000..4dded840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x44a66b20> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
        at java.lang.Object.wait(Object.java:426)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:512)
        - locked <0x44a66b20> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
        at java.lang.Thread.run(Thread.java:536)

"HostConfig[localhost]" daemon prio=1 tid=0x0x838ef48 nid=0x4165 waiting on
condition [4dc6d000..4dc6d840]
        at java.lang.Thread.sleep(Native Method)
        at org.apache.catalina.startup.HostConfig.threadSleep(Unknown
Source)
        at org.apache.catalina.startup.HostConfig.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)

"StandardManager[/manager]" daemon prio=1 tid=0x0x838da58 nid=0x4164 waiting
on condition [4dbec000..4dbec840]
        at java.lang.Thread.sleep(Native Method)
        at org.apache.catalina.session.StandardManager.threadSleep(Unknown
Source)
        at org.apache.catalina.session.StandardManager.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)

"StandardManager[/iepmms]" daemon prio=1 tid=0x0x8386b80 nid=0x4163 waiting
on condition [4dd6c000..4dd6c840]
        at java.lang.Thread.sleep(Native Method)
        at org.apache.catalina.session.StandardManager.threadSleep(Unknown
Source)
        at org.apache.catalina.session.StandardManager.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)

"StandardManager[/statsmms]" daemon prio=1 tid=0x0x82fd348 nid=0x4162
waiting on condition [4da1b000..4da1b840]
        at java.lang.Thread.sleep(Native Method)
        at org.apache.catalina.session.StandardManager.threadSleep(Unknown
Source)
        at org.apache.catalina.session.StandardManager.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)

"StandardManager[/MMS]" daemon prio=1 tid=0x0x82c08a8 nid=0x4161 waiting on
condition [4d599000..4d599840]
        at java.lang.Thread.sleep(Native Method)
        at org.apache.catalina.session.StandardManager.threadSleep(Unknown
Source)
        at org.apache.catalina.session.StandardManager.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)

"StandardManager[/mmbox]" daemon prio=1 tid=0x0x810c5b0 nid=0x4160 waiting
on condition [4d4ac000..4d4ac840]
        at java.lang.Thread.sleep(Native Method)
        at org.apache.catalina.session.StandardManager.threadSleep(Unknown
Source)
        at org.apache.catalina.session.StandardManager.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)

"StandardManager[/admin]" daemon prio=1 tid=0x0x8730948 nid=0x415f waiting
on condition [4d151000..4d151840]
        at java.lang.Thread.sleep(Native Method)
        at org.apache.catalina.session.StandardManager.threadSleep(Unknown
Source)
        at org.apache.catalina.session.StandardManager.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:536)

"Signal Dispatcher" daemon prio=1 tid=0x0x808d3d0 nid=0x415c waiting on
condition [0..0]

"Finalizer" daemon prio=1 tid=0x0x80867d8 nid=0x4159 in Object.wait()
[4c3f2000..4c3f2840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x446e3cb0> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
        - locked <0x446e3cb0> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=1 tid=0x0x8085b90 nid=0x4158 in
Object.wait() [4c371000..4c371840]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x446e3d18> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:426)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:113)
        - locked <0x446e3d18> (a java.lang.ref.Reference$Lock)

"main" prio=1 tid=0x0x8051e68 nid=0x4155 runnable [bfffc000..bfffd580]
        at java.net.PlainSocketImpl.socketAccept(Native Method)
        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
        - locked <0x44a91330> (a java.net.PlainSocketImpl)
        at java.net.ServerSocket.implAccept(ServerSocket.java:439)
        at java.net.ServerSocket.accept(ServerSocket.java:410)
        at org.apache.catalina.core.StandardServer.await(Unknown Source)
        at org.apache.catalina.startup.Catalina.start(Unknown Source)
        at org.apache.catalina.startup.Catalina.execute(Unknown Source)
        at org.apache.catalina.startup.Catalina.process(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:324)
        at org.apache.catalina.startup.Bootstrap.main(Unknown Source)

"VM Thread" prio=1 tid=0x0x8082950 nid=0x4157 runnable

"VM Periodic Task Thread" prio=1 tid=0x0x808bf18 nid=0x415a waiting on
condition
"Suspend Checker Thread" prio=1 tid=0x0x808c968 nid=0x415b runnable

----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
--------


On Thu, 9 Jan 2003, Joao Filipe Placido wrote:

> Date: Thu, 9 Jan 2003 14:58:02 -0000
> From: Joao Filipe Placido <joao-f-placido@ptinovacao.pt>
> To: 'Craig R. McClanahan' <craigmcc@apache.org>,
>      'Tomcat Users List' <tomcat-user@jakarta.apache.org>
> Subject: RE: HELP, PLEASE! Tomcat creates too many threads!
>
> Hi,
>
> When using SingleThreadModel in the servlets, old tomcat threads never
die,
> and new threads are created for each request, so I have to restart tomcat
> once in a while. I'm using linux and JDK 1.4.1 with Tomcat 4.1.12.
>
> Anyone knows how to make old threads get killed?
>

Using SingleThreadModel (by itself) has no impact on how many threads get
created -- it only affects how many instances of your servlet get created.
(Of course, I think using STM is a bad idea anyway, because it only gives
you a false sense of security about thread safety, but that's a different
issue.)

The only reasonable way to debug this kind of situation is to trigger a
thread dump after you've tried to shut Tomcat down, to see what the
remaining threads are actually doing.  If you're running Tomcat directly
from a console window on Unix, for example, you should be able to press
CTRL+\ (backslash) to trigger the dump.

> Thank you.
>
> Joao Filipe Placido

Craig


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message