R
Ron M
Is there a way of displaying the stack trace of a running ruby program without killing it?
Java virtual machines(*) will show the stack trace(s) of a running program
if you send them a QUIT signal (or on windows <ctrl><break>) without stopping
the program. On Linux, the "pstack" program gives you the same capabilities
for C programs.
This is useful when a program runs for days and gets gradually slower. By
periodically sending QUIT signals you can essentally poll the program's
stack to see where it's getting slow.
Is there any way to do similar in Ruby? Even if I need to attach using
GDB, it would help me - but I'd need someone to point me to what data
structures I should look at with the debugger. Otherwise, I think it'd
be a really nice feature if, like java, a QUIT signal could show the
stack trace(s) of the existing nthread(s) without killing an application
Ron
* http://java.sun.com/developer/technicalArticles/Programming/Stacktrace/
* http://linuxcommand.org/man_pages/pstack1.html
Java virtual machines(*) will show the stack trace(s) of a running program
if you send them a QUIT signal (or on windows <ctrl><break>) without stopping
the program. On Linux, the "pstack" program gives you the same capabilities
for C programs.
This is useful when a program runs for days and gets gradually slower. By
periodically sending QUIT signals you can essentally poll the program's
stack to see where it's getting slow.
Is there any way to do similar in Ruby? Even if I need to attach using
GDB, it would help me - but I'd need someone to point me to what data
structures I should look at with the debugger. Otherwise, I think it'd
be a really nice feature if, like java, a QUIT signal could show the
stack trace(s) of the existing nthread(s) without killing an application
Ron
* http://java.sun.com/developer/technicalArticles/Programming/Stacktrace/
* http://linuxcommand.org/man_pages/pstack1.html