How to get a complete stack trace of a running java program that is taking 100% cpu?

sorin picture sorin · May 25, 2012 · Viewed 53.6k times · Source

I do have a jenkins instance that is stuck in some kind of endless loop without any visible activity.

I can get the pid of the running process so how do I generate a trace that I can use for a bug report?

I'm running on linux.

Answer

mprivat picture mprivat · May 25, 2012

Try with jstack. It'll give you a full list of what your threads are doing. All it needs is the process pid.