thread-dump

How to find out which thread holds the monitor?

痴心易碎 提交于 2019-12-03 14:40:27
问题 My application is using Gson 2.2 for converting POJOs to JSON . When I was making a load test I stumbled upon a lot of threads blocked in Gson constructor: "http-apr-28201-exec-28" #370 daemon prio=5 os_prio=0 tid=0x0000000001ee7800 nid=0x62cb waiting for monitor entry [0x00007fe64df9a000] java.lang.Thread.State: BLOCKED (on object monitor) at com.google.gson.Gson.<init>(Gson.java:200) at com.google.gson.Gson.<init>(Gson.java:179) Thread dump does NOT show any threads holding

Java Thread Dump Summarisation Tool

萝らか妹 提交于 2019-12-03 13:12:24
I sometimes have to look at thread dumps from a Tomcat server. However, this is a very slow process as my application uses thread pools with a couple of hundred threads. Most of the thread dumps I look at include the same stack trace for many of the threads as they are idle waiting for work. Are there any tools which would parse a thread dump and only show me the unique stack traces along with a count of the number of threads in each state? This would allow me to quickly ignore the tens or hundreds of threads which are waiting in a common location for work. I have tried the Thread Dump

Java thread dump: WAITING (on object monitor) - what is it waiting on?

自闭症网瘾萝莉.ら 提交于 2019-12-03 07:04:17
there was a similar question asked java-thread-dump-waiting-on-object-monitor-line-not-followed-by-waiting-on , but there was no concrete answer, so I will ask my question in hopes to get more info... In the following thread dump I see that the thread is in the "WAITING (on object monitor)" state - but there is no line with "waiting on " that would indicate what it is waiting for. How do I interpret this thread stack and find out why (and what resource) this thread is waiting on? "eventTaskExecutor-50" prio=10 tid=0x0000000004117000 nid=0xd8dd in Object.wait() [0x00007f8f457ad000] java.lang

Understanding the Reference Handler thread

社会主义新天地 提交于 2019-12-03 04:44:36
I am continuing my path to deep understanding of Java Thread. Unfortunately my Java Certification didn't cover that part, so the only way of learning is to post a series of dumb questions. With so many years of Java Development, I am sometimes wondering how much I still have to learn :-) In particular my attention is now with the reference handler thread. "Reference Handler" daemon prio=10 tid=0x02da3400 nid=0xb98 in Object.wait() [0x0302f000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x1aac0320> (a java.lang.ref.Reference$Lock)

What is “Locked ownable synchronizers” in thread dump?

百般思念 提交于 2019-12-03 02:42:57
I am trying to understand what does Locked ownable synchronizers refer to in a thread dump? I started using ReentrantReadWriteLock have a thread in WAITING state, waiting for a ReentrantReadWriteLock$FairSync in the "locked ownable synchronizers" list of another thread in WAITING state (a ThreadPoolExecutor ). I couldn't find much information about that. Is it some kind of locks "passed onto" the thread? I'm trying to figure out where my deadlock comes from and I can't see any thread actively locking those (i.e. no corresponding - locked <0x...> in any stack trace). TL;DR: write locks appear

Java thread dump: Difference between “waiting to lock” and “parking to wait for”?

邮差的信 提交于 2019-12-03 01:53:37
问题 In a Java thread dump, you can see locks mentioned within stack traces. There seems to be three kinds of information: 1: - locked <0x00002aab329f7fa0> (a java.io.BufferedInputStream) 2: - waiting to lock <0x00002aaaf4ff6fa0> (a org.alfresco.repo.lock.LockServiceImpl) 3: - parking to wait for <0x00002aaafbf70bb8> (a java.util.concurrent.SynchronousQueue$TransferStack) 1: The thread has obtained a lock on object 0x00002aab329f7fa0. 2&3: Seem to say that the thread is waiting for the lock on

Java thread dump: Difference between “waiting to lock” and “parking to wait for”?

限于喜欢 提交于 2019-12-02 15:29:08
In a Java thread dump, you can see locks mentioned within stack traces. There seems to be three kinds of information: 1: - locked <0x00002aab329f7fa0> (a java.io.BufferedInputStream) 2: - waiting to lock <0x00002aaaf4ff6fa0> (a org.alfresco.repo.lock.LockServiceImpl) 3: - parking to wait for <0x00002aaafbf70bb8> (a java.util.concurrent.SynchronousQueue$TransferStack) 1: The thread has obtained a lock on object 0x00002aab329f7fa0. 2&3: Seem to say that the thread is waiting for the lock on said object to become available... but what is the difference 2 and 3? You will get "waiting to lock" in

What does thread dump looks like when JVM spent time in GC

 ̄綄美尐妖づ 提交于 2019-12-01 20:27:46
问题 When profiling Java application I note interesting fact. When JVM is in GC spiral of death thread dump is looks like: "1304802943@qtp-393978767-9985" prio=10 tid=0x00007f3ed02dd000 nid=0x74e7 in Object.wait() [0x000000004febb000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:626) - locked <0x00000007aed40048> (a org.mortbay.thread.QueuedThreadPool$PoolThread)

What does thread dump looks like when JVM spent time in GC

拟墨画扇 提交于 2019-12-01 19:28:12
When profiling Java application I note interesting fact. When JVM is in GC spiral of death thread dump is looks like: "1304802943@qtp-393978767-9985" prio=10 tid=0x00007f3ed02dd000 nid=0x74e7 in Object.wait() [0x000000004febb000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:626) - locked <0x00000007aed40048> (a org.mortbay.thread.QueuedThreadPool$PoolThread) "26774405@qtp-393978767-9984" prio=10 tid=0x00007f3ee4b37000 nid=0x74e6 in Object.wait() [0x0000000045d1a000]

Thread dump blocked AND locked

邮差的信 提交于 2019-12-01 09:19:05
This is similar to Java thread dump: BLOCKED thread without "waiting to lock ..." . Basically, I am seeing a BLOCKED thread but it has the lock it is waiting for: "pool-1-thread-60" prio=10 tid=0x00007fbf10017000 nid=0x210 waiting for monitor entry [0x00007fbed64e3000] java.lang.Thread.State: BLOCKED (on object monitor) at org.apache.log4j.Category.callAppenders(Category.java:204) - locked <0x0000000742444ad0> (a org.apache.log4j.Logger) at org.apache.log4j.Category.forcedLog(Category.java:391) at org.apache.log4j.Category.info(Category.java:666) ... I would expect to see - waiting to lock