0N/AUsing HotSpot Serviceability Agent (SA)
0N/A<
h1>Using HotSpot Serviceability Agent (SA)</
h1>
0N/AThe top-level GUI program using the HotSpot Serviceability Agent APIs is
0N/Acalled <
b>HSDB</
b>, the "HotSpot Debugger". To run it, type "
hsdbproc.sh"
0N/AThere are three modes for the SA debugger:
0N/A<
li>attaching to a local process,
0N/A<
li>opening a core file, and
0N/A<
li>attaching to a remote "debug server".
0N/AThe remote case requires two programs to be running on the remote machine:
0N/Arun this in the background) and the debug server (see the script
0N/Athe process ID or the executable and core file names to allow remote debugging
0N/A<
h3>Command line HSDB</
h3>
0N/Aor 64-bit variants). There is also a JavaScript based command line interface
0N/Acommand line interfaces can be found in
0N/A<
h3>Other command line tools</
h3>
0N/AThe following table lists all SA command line tools. <xxx>
windbg.bat 0N/Afiles are for Windows. .sh files are for Solaris. <xxx>
64.sh are for
0N/Adumps name and value of all -XX JVM command line arguments passed
0N/A<
a name="dumpsysprops"></
a>
0N/AThis prints name and value of Java level System properties.
0N/A<
a name="heapdump"></
a>
0N/ADumps heap in a file in hprof binary format.
0N/A<
a name="heapsum"></
a>
0N/APrints summary information on Java heap.
0N/AThis can retrieve .class files from the debuggee.
0N/Aset the environment variable <
b>JCORE_PACKAGES</
b> to comman separated list of
0N/Apackages whose classes have to be retrieved from the core file.
0N/Aused to get java stack trace for all java threads.
0N/Aused to get object histogram of java heap.
0N/ATo gather statistics on perm. generation.
0N/A<
a name="mixed_pstack"></
a>
0N/AThis is cross platform mixed mode pstack utility. This works on any (non-java as well) process, core dump. For java process and core dumps, this prints both java and C/C++ frames.
0N/AThis is cross platform Solaris pmap-like utility.
0N/AThis is command line SOQL - Simple Object Query Language tool.
0N/ASOQL is SQL-like query language to query Java heap.
0N/AThese scripts are used to run SA remotely.
0N/A<
h3>Debugging transported core dumps</
h3>
0N/AWhen a core dump is moved from the machine where it was produced to a
0N/Adifference machine, it may not always be possible for SA to debug the same.
0N/AMore info. on debugging on transported core dumps is in
0N/ANot all of the possible states of target VMs have been tested (or
0N/Asupportable) with SA. For example, the SA will probably not work at all
0N/Aif it freezes the target VM during certain phases of GC. When filing bugs
0N/Aa pointer to a core file (see gcore(1)) which the SA can not handle well