UIL2 ReadTask / WriteTask thread leak on 4.0.5 GA
gogoasa Feb 12, 2008 1:03 PMHello,
I see the thread leak problem described in http://jira.jboss.org/jira/browse/JBAS-4525 was backported for the 4.0.3 branch in http://jira.jboss.org/jira/browse/ASPATCH-300.
I am using 4.0.5GA, and still the thread leak behaviour manifests itself. Inspecting the jvm with JConsole, i can see lots of UIL2.SocketManager.ReadTask /WriteTask pairs that accumulate. When the number of started threads reaches a couple of millions, I get OutOfMemoryError. Could anybody confirm that the patch made it to 4.0.5.GA too and not only to 4.0.3sp1. ? Any other advice?
For illustration, here is the stacktrace of a blocked ReadTask :
Name: UIL2.SocketManager.ReadTask#1 client=172.20.20.160:8093 State: RUNNABLE Total blocked: 0 Total waited: 0 Stack trace: java.net.SocketInputStream.socketRead0(Native Method) java.net.SocketInputStream.read(SocketInputStream.java:129) java.io.BufferedInputStream.fill(BufferedInputStream.java:218) java.io.BufferedInputStream.read(BufferedInputStream.java:235) org.jboss.util.stream.NotifyingBufferedInputStream.read(NotifyingBufferedInputStream.java:79) java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2196) java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2376) java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2443) java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2515) java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2664) java.io.ObjectInputStream.readByte(ObjectInputStream.java:875) org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:316) java.lang.Thread.run(Thread.java:595)
and of a blocked WriteTask :
Name: UIL2.SocketManager.WriteTask#3 client=172.20.20.160:3486 State: WAITING on java.lang.Object@67692e Total blocked: 0 Total waited: 69 Stack trace: java.lang.Object.wait(Native Method) java.lang.Object.wait(Object.java:474) EDU.oswego.cs.dl.util.concurrent.LinkedQueue.take(LinkedQueue.java:122) org.jboss.mq.il.uil2.SocketManager$WriteTask.run(SocketManager.java:518) java.lang.Thread.run(Thread.java:595)
Thank you,
Adrian.