Analysing threads through eclipse debug view

北战南征 提交于 2019-12-05 00:10:15

问题


If a multi threaded application is running in debug from eclipse then is there any way to know which thread is sleeping or waiting by looking into debug view where all the threads are listed? As I can only see running threads there.


回答1:


All the threads are shown, the (Running) value just means you have not suspended the thread. You can use the Suspend button to suspend an individual thread or the entire application. When you do this you can expand the entry for the thread in the view and see if it is sleeping, waiting or executing code.

Single suspended thread which is waiting: enter image description here




回答2:


You can use JvisualVM to get a graph over time of which threads are running/sleeping. JvisualVM comes with your JDK. If you are looking for a performance issue, it also has a profiler. There is also a plugin for eclipse (which I've never used) that can help with launching it. http://visualvm.java.net/eclipse-launcher.html



来源:https://stackoverflow.com/questions/19176954/analysing-threads-through-eclipse-debug-view

工具导航Map

JSON相关