debugging Java synchronization

后端 未结 2 1222
臣服心动
臣服心动 2021-01-04 06:56

Is there any mechanism within the Eclipse debugging environment to see the state of synchronization locks held and processes waiting?

2条回答
  •  一整个雨季
    2021-01-04 07:39

    As suggested here you could (if you run the Sun JVM) perform the following steps:

    1. launch jconsole or jvisualvm (both present in the bin-directory of your JDK-installation,
    2. attach to the process you suspect has locked up
    3. go to the Threads pane. There is a "Detect Deadlock" button

提交回复
热议问题