Jstack

From NovaOrdis Knowledge Base
Revision as of 15:40, 13 October 2017 by Ovidiu (talk | contribs) (→‎Overview)
Jump to navigation Jump to search

External

Internal

Overview

JVM thread dumps can be generated with jstack that ships with the JDK. In order to take a full JVM thread dump, identify the PID of the target JVM and Dumps the thread stacks at stdout:

jstack -l <pid> > <dump-file-name.txt>

Insufficient memory or insufficient privileges to attach

When getting this, I made it work by using -F command line option:

jstack -F <pid>

Options

-F

Frce a thread dump. Use when jstack <pid> does not respond (process is hung).

-m

Print both java and native frames (mixed mode).

-l

Long listing. Prints additional information about locks.