Hello JJ!
Majority of your threads are in TIMED_WAITING state and most of them tend to have this sort of stack trace:
java.lang.Thread.State: TIMED_WAITING
prio=5 blockedtime=4 blockedcount=3 waitedtime=180048694 waitedcount=3957
at java.base@11.0.9/jdk.internal.misc.Unsafe.park(Native Method)
at java.base@11.0.9/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:234)
at java.base@11.0.9/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2123)
at java.base@11.0.9/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1182)
at java.base@11.0.9/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
at java.base@11.0.9/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
at java.base@11.0.9/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
at java.base@11.0.9/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base@11.0.9/java.lang.Thread.run(Thread.java:834)
Strong Suspect - 'Not shutting down executor':
Your application is using internal thread pool (i.e. ThreadPoolExecutor). And it looks like you are creating new Thread Pools for very frequently (may be even every request) and not shutting down the thread pool explcitly after usage. This is obvious based on the thread names in your thread dump:
Above is the excerpt from your thread dump analsyis report generated by fastThread showing the thread names. If you see pool counter is getting incremented but thread count remains to be 1. It tells, you are creating multiple thread pools, but each thread pool just has 1 thread in it. After usage, you are not shutting down the executor. Inorder to shutdown the executor, you need to invoke the 'Shutdown()' API.
We have solved similar problem in another application and documented our findings here. Take a look at it, you might be also running in to same issue.
NOTE: Invoking 'shutdown()' API should resolve your immediate problem. However it's not a recommended practise to create multiple thread pools with each having 1 thread in it. You may consider creating 1 thread pool with multiple threads in it.
Edit your Comment