0N/A<html>
0N/A<head>
0N/A<title>
0N/AUsing HotSpot Serviceability Agent (SA)
0N/A</title>
0N/A</head>
0N/A<body>
0N/A<h1>Using HotSpot Serviceability Agent (SA)</h1>
0N/A
0N/A<h3>HSDB GUI</h3>
0N/A<p>
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/Aor "hsdbwindbg.bat" or 64-bit variants (on Unix, Windows platforms
0N/Arespectively). More info. on HSDB GUI are in <a href="hsdb.html">hsdb.html</a>.
0N/A</p>
0N/A
0N/A<h3>SA Modes</h3>
0N/A<p>
0N/AThere are three modes for the SA debugger:
0N/A<ul>
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/A</ul>
0N/A<p>
0N/AThe remote case requires two programs to be running on the remote machine:
0N/Athe rmiregistry (see the script "start-rmiregistry.sh" in this directory;
0N/Arun this in the background) and the debug server (see the script
0N/A"start-debug-server-proc.sh"), in that order. start-rmiregistry.sh takes no
0N/Aarguments; start-debug-server-proc.sh (or -windbg.bat) takes as argument
0N/Athe process ID or the executable and core file names to allow remote debugging
0N/Aof.
0N/A</p>
0N/A
0N/A<h3>Command line HSDB</h3>
0N/A<p>
0N/AThere are also command line HSDB variants ("clhsdbproc.sh" or "clhsdbwindbg.bat"
0N/Aor 64-bit variants). There is also a JavaScript based command line interface
0N/Acalled "jsdbproc.sh" [or "jsdbwindbg.bat" or 64-bit variants]. More details on
0N/Acommand line interfaces can be found in
0N/A<ul>
0N/A<li><a href="clhsdb.html">clhsdb.html</a>
0N/A<li><a href="jsdb.html">jsdb.html</a>
0N/A</ul>
0N/A</p>
0N/A
0N/A<h3>Other command line tools</h3>
0N/A<p>
0N/AThe following table lists all SA command line tools. &lt;xxx&gt;windbg.bat
0N/Afiles are for Windows. .sh files are for Solaris. &lt;xxx&gt;64.sh are for
0N/A64 bit debugees.
0N/A</p>
0N/A
0N/A<table border="1">
0N/A<tr>
0N/A<th>
0N/ATool
0N/A</th>
0N/A<th>
0N/ADescription
0N/A</th>
0N/A</tr>
0N/A
0N/A<tr>
0N/A<td>
0N/Adumpflagsproc.sh,
0N/Adumpflagsproc64.sh,
0N/Adumpflagswindbg.bat
0N/Adumpflagswindbg64.bat
0N/A</td>
0N/A<td>
0N/Adumps name and value of all -XX JVM command line arguments passed
0N/Ato debuggee.
0N/A</td>
0N/A</tr>
0N/A
0N/A<tr>
0N/A<td>
0N/A<a name="dumpsysprops"></a>
0N/Adumpsyspropsproc.sh,
0N/Adumpsyspropsproc64.sh,
0N/Adumpsyspropswindbg.bat
0N/Adumpsyspropswindbg64.bat
0N/A</td>
0N/A<td>
0N/AThis prints name and value of Java level System properties.
0N/A</td>
0N/A</tr>
0N/A
0N/A<tr>
0N/A<td>
0N/A<a name="heapdump"></a>
0N/Aheapdumpproc.sh,
0N/Aheapdumpproc64.sh,
0N/Aheapdumpwindbg.bat
0N/Aheapdumpwindbg64.bat
0N/A</td>
0N/A<td>
0N/ADumps heap in a file in hprof binary format.
0N/A</td>
0N/A</tr>
0N/A
0N/A<tr>
0N/A<td>
0N/A<a name="heapsum"></a>
0N/Aheapsumproc.sh,
0N/Aheapsumproc64.sh,
0N/Aheapsumwindbg.bat
0N/Aheapsumwindbg64.bat
0N/A</td>
0N/A<td>
0N/APrints summary information on Java heap.
0N/A</td>
0N/A</tr>
0N/A
0N/A
0N/A<tr>
0N/A<td>
0N/Ajcoreproc.sh,
0N/Ajcoreproc64.sh,
0N/Ajcorewindbg.bat
0N/Ajcorewindbg64.bat
0N/A</td>
0N/A<td>
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/A</td>
0N/A</tr>
0N/A
0N/A<tr>
0N/A<tr>
0N/A<td>
0N/Ajstackproc.sh,
0N/Ajstackproc64.sh,
0N/Ajstackwindbg.bat
0N/Ajstackwindbg64.bat
0N/A</td>
0N/A<td>
0N/Aused to get java stack trace for all java threads.
0N/A</td>
0N/A</tr>
0N/A
0N/A<tr>
0N/A<td>
0N/Ajhistoproc.sh,
0N/Ajhistoproc64.sh,
0N/Ajhistowindbg.bat
0N/Ajhistowindbg64.bat
0N/A</td>
0N/A<td>
0N/Aused to get object histogram of java heap.
0N/A</td>
0N/A</tr>
0N/A
0N/A<tr>
0N/A<td>
0N/Apermstatproc.sh,
0N/Apermstatproc64.sh,
0N/Apermstatwindbg.bat
0N/Apermstatwindbg64.bat
0N/A</td>
0N/A<td>
0N/ATo gather statistics on perm. generation.
0N/A</td>
0N/A</tr>
0N/A
0N/A<a name="mixed_pstack"></a>
0N/A<tr>
0N/A<tr>
0N/A<td>
0N/Apstackproc.sh,
0N/Apstackproc64.sh,
0N/Apstackwindbg.bat
0N/Apstackwindbg64.bat
0N/A</td>
0N/A<td>
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/A</td>
0N/A</tr>
0N/A
0N/A<tr>
0N/A<td>
0N/Apmapproc.sh,
0N/Apmapproc64.sh,
0N/Apmapwindbg.bat
0N/Apmapwindbg64.bat
0N/A</td>
0N/A<td>
0N/AThis is cross platform Solaris pmap-like utility.
0N/A</td>
0N/A</tr>
0N/A
0N/A<tr>
0N/A<td>
0N/Asoqlproc.sh,
0N/Asoqlproc64.sh,
0N/Asoqlwindbg.bat
0N/Asoqlwindbg64.bat
0N/A</td>
0N/A<td>
0N/AThis is command line SOQL - Simple Object Query Language tool.
0N/ASOQL is SQL-like query language to query Java heap.
0N/A</td>
0N/A<tr>
0N/A<td>
0N/Astart-debug-server-proc.sh,
0N/Astart-debug-server-proc64.sh,
0N/Astart-debug-server-windbg.bat,
0N/Astart-debug-server-windbg64.bat,
0N/Astart-rmiregistry.bat,
0N/Astart-rmiregistry64.bat,
0N/Astart-rmiregistry.sh
0N/Astart-rmiregistry64.sh
0N/A</td>
0N/A<td>
0N/AThese scripts are used to run SA remotely.
0N/A</td>
0N/A</tr>
0N/A</table>
0N/A
0N/A<h3>Debugging transported core dumps</h3>
0N/A<p>
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/A<a href="transported_core.html">transported_core.html</a>.
0N/A</p>
0N/A
0N/A<h3>SA Bugs</h3>
0N/A<p>
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
0N/Ais best.
0N/A</p>
0N/A
0N/A</body>
0N/A</html>