• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to debug multithreaded application?

 
Ranch Hand
Posts: 954
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 954
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 954
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I swear i tried but could not able to understand it. Thanks..
 
Ranch Hand
Posts: 230
IntelliJ IDE Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

reply
    Bookmark Topic Watch Topic
  • New Topic