Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Analysing threads through eclipse debug view

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.

like image 531
Ishan Rastogi Avatar asked Oct 04 '13 08:10

Ishan Rastogi


2 Answers

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

like image 151
greg-449 Avatar answered Sep 27 '22 18:09

greg-449


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

like image 40
Alcanzar Avatar answered Sep 27 '22 18:09

Alcanzar