Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

How to debug multithreaded application?  RSS feed

 
Ranch Hand
Posts: 947
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to debug our multi threaded application (non gui) to fix 1 client bug. Normally i can debug in eclipse but have never debug in multi threaded environment.

I am unable to find any good resources. Any help is appreciated?
 
Sheriff
Posts: 23714
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What problems have you encountered when debugging the application in Eclipse? And what kind of "resources" are you looking for? I've debugged a multi-threaded application in Eclipse without realizing that I had to know anything special, and I didn't run into any problems really.
 
Tushar Goel
Ranch Hand
Posts: 947
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
problems like identifying deadlock, method and variables process by any thread and switching between threads.

I was looking for resources to identify this problem may be any tool (I just found out about JProfiler and YourKit) or documentation of how to perform debugging in eclipse in multi threaded environment.

I agree i don't have very much exposure to eclipse debugging too.
 
Paul Clapham
Sheriff
Posts: 23714
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The debug window shows you all active threads separately. To examine the variables in a thread you just set a breakpoint and when a thread reaches that breakpoint it will stop and allow you to do that -- just like normal for Eclipse. To "switch threads" -- if I'm interpreting that right -- you just click on a different thread in the debug window. Identifying deadlock -- well, the debug window tells you about locks held by the threads. Really, this is a non-problem. I'm guessing you haven't even tried it yet.
 
Tushar Goel
Ranch Hand
Posts: 947
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I swear i tried but could not able to understand it. Thanks..
 
Ranch Hand
Posts: 227
Eclipse IDE IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try Hands on JProfiler as it will give a upper hand in narrowing down to detect Deadlock between threads

Its a good idea to take multiple Thread dumps in an interval of 5-10 secs so that you can compare the activity of threads in different dumps.

If you have jstack on the machine where process is running,
jstack {pid} > threaddump.log
kill -3 {pid}
Using jvisiualvm or jconsole, you can connect to the local/remote process and generate the thread Dump.

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!