Figure out where my nodejs thread is hanging?
<p>I have a node server running. Once in a while, the main thread hangs and goes to 100% CPU usage. The thread is totally hung and not processing any further events whatsoever.</p>

<p>Unfortunately, because of this, even attaching the node debugger is not useful since the thread is hung somewhere (I ran node's debugger and attached to the stalled process but [for example] 'pause' or 'bt' does not return).</p>

<p>How can I figure out where it is hanging? Is it possible to have node keep track of the current closure stack so that I can get access to it retrospectively when the bug occurs again?</p>