You can give a process identifier (PID) and jstack will dump the stacks of all the threads in the Java application. Perhaps it is a tight CPU loop (as a result of a poorly written while loop which didn’t update the conditional variable correctly) or the code is blocking on something such as I/O or, worst case scenario, a mutex that is held by another thread waiting for a mutex the other thread is holding (deadlock). This is especially useful when a program “freezes” instead of crashes – because it helps you to isolate where the program has gone wrong. I find it incredibly useful to dump the stack of a running program. This post is likely to be a work in progress as I collate information that is useful to me on the one post.
0 Comments
Leave a Reply. |