Usage: jstack [-l] <pid> (to connect to running process) jstack -F [-m] [-l] <pid> (to connect to a hung process) jstack [-m] [-l] <executable> <core> (to connect to a core file) jstack [-m] [-l] [server_id@]<remote server IP or hostname> (to connect to a remote debug server)
Options: -F to force a thread dump. Use when jstack <pid> does not respond (process is hung) -m to print both java and native frames (mixed mode) -l long listing. Prints additional information about locks -h or -help to print this help message
#Print full HotSpot and JDK version ID jcmd <process id/main class> VM.version #Print all the system properties set for a VM jcmd <process id/main class> VM.system_properties #Print all the flags used for a VM jcmd <process id/main class> VM.flags #Print the uptime in seconds jcmd <process id/main class> VM.uptime #Create a class histogram jcmd <process id/main class> GC.class_histogram #Create a heap dump (hprof dump) jcmd GC.heap_dump filename=Myheapdump #Create a heap histogram jcmd <process id/main class> GC.class_histogram filename=Myheaphistogram #Print all threads with stack traces jcmd <process id/main class> Thread.print #Start a recording jcmd 7060 JFR.start name=MyRecording settings=profile delay=20s duration=2m filename=C:\TEMP\myrecording.jfr #Check a recording jcmd 7060 JFR.check #Stop a recording jcmd 7060 JFR.stop #Dump a recording jcmd 7060 JFR.dump name=MyRecording filename=C:\TEMP\myrecording.jfr