By default, using Hotspot, a CTRL-Break thread dump will not list which threads store java.lang.concurrent locks. And I understand that with these locks Hotspot cannot have information about which stack stack a lock was acquired on. If you add the JVM -XX:+PrintConcurrentLocks , then the CTRL-Break stack dump will display (after tracing the thread stack) any simultaneous locks held by this frame. For instance:
"D-Java-5-Lock" prio=6 tid=0x00000000069a1800 nid=0x196c runnable [0x000000000770f000] java.lang.Thread.State: RUNNABLE at com.Tester.longDelay(Tester.java:41) at com.Tester$D.run(Tester.java:88) Locked ownable synchronizers: - <0x00000007d6030898> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
Without this option, it is not possible to determine which thread holds this lock after death. Why is this parameter not the default? Is there an unobvious performance or forfeit? When I search to find a discussion of this, nothing comes.
Eddie source share