Recently I was working away developing and repeatedly kept having Eclipse lock up on me via a deadlock. Annoying!
Since I have the privilege of working both on and in Eclipse I had the tools at hand to diagnose the problem. Since your CPU is not doing any work whilst sitting in a deadlock you may as well invoke the debugger and log the bug to save yourself and others future pain.
Of course I knew the problem was not in my code :-)
But I had no idea where the bug might be hiding.
So I launched a debug session of the Eclipse application and performed the steps I knew would lead to the deadlock.
Once in the deadlock I went to the debug view, and set it to show monitor information via the view menu.
I selected the debug process and clicked "pause".
This will pause the JVM and suspend execution of all threads (not like they were doing anything anyway!).
The Eclipse debug framework will make it easy for your to diagnose and report the problem.
Within the view, the threads that are in contention will be indicated in red. The monitor(s) that a thread is waiting for and/or owns are indicated.
In the simple example shown below we have two threads that are deadlocked
Even better when you log the bug report you can provide stack traces pointing right to the problem.
Happy debugging.
Monday, October 15, 2007
Subscribe to:
Post Comments (Atom)
Labels
- running
- races
- eclipse
- training
- family
- eclipseCon
- reasontorun
- camping
- ChristmasCamp
- jazz
- track
- eclipseConExercise
- biking
- adventure
- beach
- micah
- pacing
- sandcastle
- trisha
- vacation
- western states
- hardrock100
- oscon
- bighorn100
- catalyst challenge
- christmas
- church
- tourist run
- bookreview
- bootcamp
- coaching
- conference
- forestpark
- leah
- movie
- paceOfCourage
- prison
- review
5 comments:
you learn something new everyday :D
Darin,
it's excellent. But you were running Eclipse in Eclipse, right?
What I really miss, is that often Eclipse works really good for me, but when it hangs I's always after I launched it just for few seconds and left for hours. Maybe adding some params to my eclipse.ini would help.
You are correct Jacek.
Your problem could be:
- eclipse is being swapped back into active memory?
- there is a leak and Eclipse has run out of memory after being left open for a long time...which would be a bug.
You can also use the default VM dump etc to report the problem. Details found at: http://wiki.eclipse.org/How_to_report_a_deadlock
I could apply this to something I was working on today. Thanks for posting it :-).
Thanks Elias. I look forward to meeting you at the Eclipse demo camp.
Post a Comment