Hi all:

    Out web site use Nginx infront of tomcat6.0.28, nio connector, in heavy
load running about 24 hours, tomcat can't accept request, we must restart
tomcat .

check nginx error log, there are lots of "Connection timed out", print
tomcat jstack, found most tomcat threads is "TIMED_WAITING", like this:

 

"http-10.132.23.74-8090-exec-54" daemon prio=10 tid=0x00002aab36ecec00
nid=0x3175 waiting on condition [0x00000000498c0000..0x00000000498c0e20]

   java.lang.Thread.State: TIMED_WAITING (parking)

    at sun.misc.Unsafe.park(Native Method)

    - parking to wait for  <0x00002aaaba3cf768> (a
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)

    at
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)

    at
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitN
anos(AbstractQueuedSynchronizer.java:1963)

    at
java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:395)

    at
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:944)

    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:9
06)

    at java.lang.Thread.run(Thread.java:619)

 

print jmap, we found we have lots of memory leak:

 

num     #instances         #bytes  class name

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

   1:       7772927      336536416  [C

   2:       7774657      310986280  java.lang.String

   3:        398536      162602688  com.manu.dynasty.base.domain.User

   4:       3460146      138405840  java.sql.Timestamp

   5:       2334971      112078608  java.util.HashMap$Entry

   6:        792095      101388160  com.manu.dynasty.function.domain.Friend

.

108:           437          80408  java.net.SocksSocketImpl

 

Objects num in memory like "com.manu.dynasty.base.domain.User",
"com.manu.dynasty.function.domain.Friend" is too big than normal situation,

And the num of "java.net.SocksSocketImpl" is too small.

 

So my question is the memory leak cause tomcat can't create Socket to accept
nginx's request?

Our app is running in product envionment now , and every day we have to
restart tomcat, so any help is very appreciated

 

Reply via email to