Profile Image
Charan

where is the high thread count coming from?

How do i find where is the high thread count coming from ?

 

Report URL - https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjIvMDgvMjMvdGhyZWFkX2R1bXAuemlwLS04LTQ2LTQz

  • high-thread-count

  • threads-in-waiting-state

  • google-aips

  • threadpoolexecutor

  • memoryleakinjavaexecutor

Please Sign In or to post your comment or answer

Profile Image

sainath

Hi Charan,

 

You can notice that there are 3764 threads in waiting state. I can see that some of them are related to maps.googleaips.com and a few are related to wellsfargo. All of them as the same stack trace. Here is the stack trace of the threads:

 

stackTrace:
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x000000062baea398> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:458)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
at java.util.concurrent.SynchronousQueue.take(SynchronousQueue.java:924)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)

+ If you click on the view details button present in the thread count summary. Then it will show the details of each thread with their stack traces:

 

 

 

 

Profile Image

Ram Lakshmanan

Hello Charan!

 

 Greetings. I reviewed your thread dump report.  It looks like your application has created 4493 threads. In these 3440 threads have the identical stack trace with the WAITING state as shown in this section:

 

 

  Here is the stacktrace of those threads:

 

 

 If you notice your application is creating new thread pool (i.e. java.util.concurrent.ThreadPoolExecutor) for every new request and it's not closing it. Due to which multiple thread pools are created and each thread pool just has only one thread in it. You want to make sure to reuse the thread pool instead of creating new thread pool for every request. Also you want make sure to close the thread pool properly for the usage.

 

 Your problem sound similar to this issue: Memory Leak in Java Executor!

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • high-thread-count

  • threads-in-waiting-state

  • google-aips

  • threadpoolexecutor

  • memoryleakinjavaexecutor