Profile Image
Brett Lane

Tomcat 9 instance is hanging every 3 days. So we are suspecting it might be the unbounded GC threads. Please advice!

How production Tomcat 9 instance is hanging every 3 days or so, requiring a restart.   We are unsure of the exact cause but suspect NIO.



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

 

GC Log: https://gceasy.io/my-gc-report.jsp?p=c2hhcmVkLzIwMjEvMDMvMjMvLS10b21jYXRfZ2MtMjAyMS0wMy0xOV8xNy0xMS01OC5sb2ctLTAtMzEtMTk=&channel=WEB

  • tomcat9

  • hanging

  • nio

Profile Image

Brett Lane

That thread dump was captured during a hang, during the restart process.   So starting to suspect it might be the unbounded GC threads, as we do not set any explicitly and there are multiple JVMs running on the same machine (11 cores).  I will see if I can get the GC logs from our admin

Please Sign In or to post your comment or answer

Profile Image

Ram Lakshmanan

Hello Brett!

 

 Greetings.

 

 In the thread dump attached, I don't see any major problem. It looks like you have captured the thread dump when application was healthy. Just one observation is: you have configured 69 Garbage Collection threads. Sometimes having too many threads can turn out to be counter productive of Garbage collection. However we can't confirm this is a problem, until we see the Garbage collection log.

 

 Thread dump should have been captured during the problematic period, i.e. at the end of the 3rd day before restart the application. That too one snapshot of thread dump isn't enough, you might have to capture atleast 3 snapshots of thread dumps in a gap of 10 seconds.

 

 Tomcat can hang because of several reasons: Long GC pause, memory leak, poor DB query, lack of threads, wrong connection pool configurations, device's capacity, network latency, inefficient code, ...  Thread dump only gives small subset of information, to diagnose the problem. Inorder to diagnose tomcat hang, you need to capture 360-degree data such as: Thread dumps, Heap dumps, Garbage collection logs, vmstat, iostat, top, top -H, df, netstat... You can consider using 14-day trial of yCrash. It captures all of the above data, analyzes them and generates root cause analysis report of the slowdown.

Profile Image

Ram Lakshmanan

Hello Brett!

 

 Your GC log looks normal. It's indicating tomcat hang shouldn't have been caused due to Garbage Collection or Memory.  

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • tomcat9

  • hanging

  • nio