2023-03-14 16:40:11 Full thread dump Java HotSpot(TM) 64-Bit Server
VM (25.144-b01 mixed mode): "ajp-bio-8009-exec-276" #382 daemon
prio=5 os_prio=0 tid=0x00007ff398160800 nid=0x4d42 runnable
[0x00007ff49aab0000]
java.lang.Thread.State: RUNNABLE at
java.net.SocketInputStream.socketRead0(Native Method) at
java.net.SocketInputStream.socketRead(SocketInputStream.java:116) at
java.net.SocketInputStream.read(SocketInputStream.java:171) at
java.net.SocketInputStream.read(SocketInputStream.java:141) at
org.apache.coyote.ajp.AjpProcessor.read(AjpProcessor.java:312) at
org.apache.coyote.ajp.AjpProcessor.readMessage(AjpProcessor.java:367) at
org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:118) at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) -
locked <0x00000000c54ad030> (a
org.apache.tomcat.util.net.SocketWrapper) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at
java.lang.Thread.run(Thread.java:748)
|
Thread ID(Thread ID)
Thread ID는 각 Thread에 할당된 고유한 식별자입니다. Thread Dump에서는 Thread ID를 이용하여 각 Thread를 구분합니다. 상태 정보(State) Thread의 상태 정보는 현재 Thread가 어떤 상태에 있는지를 나타냅니다. 일반적으로 Thread는 실행(Runnable), 대기(Waiting), 차단(Blocked), 정지(Terminated) 상태 중 하나에 있습니다. Runnable: 현재 CPU에서 실행 가능한 상태 Waiting: 다른 Thread가 특정 이벤트를 발생시키기를 기다리는 상태 Blocked: 다른 Thread에 의해 lock을 점유하고 있어서 실행할 수 없는 상태 Terminated: Thread가 종료된 상태 스택 추적 정보(Stack Trace) 스택 추적 정보는 Thread가 현재 실행하고 있는 코드의 위치를 보여줍니다. 이를 통해 어떤 메서드에서 문제가 발생했는지를 파악할 수 있습니다. Monitor 정보 Monitor는 동기화를 위해 사용되는 객체입니다. Thread Dump에서는 현재 Thread가 점유하고 있는 Monitor 객체의 정보를 보여줍니다. 이 정보를 통해 데드락이 발생한 경우, 어떤 Thread가 어떤 Monitor 객체를 점유하고 있는지 파악할 수 있습니다. Lock 정보 Lock은 자바에서 동기화를 위해 사용되는 기본 개념 중 하나입니다. Thread Dump에서는 현재 Thread가 점유하고 있는 Lock 객체의 정보를 보여줍니다. 이 정보를 통해 데드락이 발생한 경우, 어떤 Thread가 어떤 Lock 객체를 점유하고 있는지 파악할 수 있습니다. 기타 정보 Thread Dump는 다양한 정보를 제공합니다. 예를 들어, 현재 Thread가 사용하는 CPU 시간, 실행 중인 메서드의 이름, Thread 이름 등을 확인할 수 있습니다. |
|
예시 1)
"ajp-bio-8009-exec-712" #44077 daemon prio=5 os_prio=0 tid=0x00007f3a30143000 nid=0x62d5 waiting for monitor entry [0x00007f39c3722000] java.lang.Thread.State: BLOCKED (on object monitor) at java.lang.Throwable.printStackTrace(Throwable.java:653) - waiting to lock <0x00000000c0b547f8> (a org.apache.tomcat.util.log.SystemLogHandler) at java.lang.Throwable.printStackTrace(Throwable.java:643) at java.lang.Throwable.printStackTrace(Throwable.java:634) at common_utils.util_database.open_mysql(util_database.java:228) at common_utils.util_database.open_connection(util_database.java:67) at org.apache.jsp.filtersvc.get_005factivepolicyitem_005flist3_jsp._jspService(get_005factivepolicyitem_005flist3_jsp.java:114) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) - locked <0x00000000ef0c6f58> (a org.apache.tomcat.util.net.SocketWrapper) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) |
위와 같은 내용이 다수 있을 경우 MySQL 커넥션시 지연되는 것으로 추정되어 DB 확인이 필요합니다.
"ajp-apr-8009-exec-228" #100092 daemon prio=5 os_prio=0 tid=0x0000000021823800 nid=0x138c0 waiting on condition [0x000000007d6ff000] java.lang.Thread.State: TIMED_WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00000000c1b365e0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467) at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:86) at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:32) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
"ajp-apr-8009-exec-227" #100086 daemon prio=5 os_prio=0 tid=0x0000000021821000 nid=0x15248 waiting on condition [0x000000007cfff000] java.lang.Thread.State: TIMED_WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00000000c1b365e0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467) at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:86) at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:32) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
"ajp-apr-8009-exec-226" #100085 daemon prio=5 os_prio=0 tid=0x000000002181d800 nid=0x13bdc waiting on condition [0x000000007caff000] java.lang.Thread.State: TIMED_WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00000000c1b365e0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078) at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467) at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:86) at org.apache.tomcat.util.threads.TaskQueue.poll(TaskQueue.java:32) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) |
위와 같은 내용이 다수 있을 경우 다수의 소켓들이 올바르게 종료되지 않은 것으로 추정됩니다.