Analyze Java Virtual Machine

Thread Dump

kill -3 <pid>

Creates a thread dump on linux.

jstack -l <pid>

also creates a thread dump on a running VM (and leaves it running).

Heap Dump

jmap -dump:format=b,file=dump.bin <pid>

Creates a dump to the file dump.bin of the passed process. The file is not human readable. Tools like MAT can help you analyze the dump.