Mon, 28 Feb 2011 22:35:01 -0800
Merge
duke@435 | 1 | <html> |
duke@435 | 2 | <head> |
duke@435 | 3 | <title> |
duke@435 | 4 | Using HotSpot Serviceability Agent (SA) |
duke@435 | 5 | </title> |
duke@435 | 6 | </head> |
duke@435 | 7 | <body> |
duke@435 | 8 | <h1>Using HotSpot Serviceability Agent (SA)</h1> |
duke@435 | 9 | |
duke@435 | 10 | <h3>HSDB GUI</h3> |
duke@435 | 11 | <p> |
duke@435 | 12 | The top-level GUI program using the HotSpot Serviceability Agent APIs is |
duke@435 | 13 | called <b>HSDB</b>, the "HotSpot Debugger". To run it, type "hsdbproc.sh" |
duke@435 | 14 | or "hsdbwindbg.bat" or 64-bit variants (on Unix, Windows platforms |
duke@435 | 15 | respectively). More info. on HSDB GUI are in <a href="hsdb.html">hsdb.html</a>. |
duke@435 | 16 | </p> |
duke@435 | 17 | |
duke@435 | 18 | <h3>SA Modes</h3> |
duke@435 | 19 | <p> |
duke@435 | 20 | There are three modes for the SA debugger: |
duke@435 | 21 | <ul> |
duke@435 | 22 | <li>attaching to a local process, |
duke@435 | 23 | <li>opening a core file, and |
duke@435 | 24 | <li>attaching to a remote "debug server". |
duke@435 | 25 | </ul> |
duke@435 | 26 | <p> |
duke@435 | 27 | The remote case requires two programs to be running on the remote machine: |
duke@435 | 28 | the rmiregistry (see the script "start-rmiregistry.sh" in this directory; |
duke@435 | 29 | run this in the background) and the debug server (see the script |
duke@435 | 30 | "start-debug-server-proc.sh"), in that order. start-rmiregistry.sh takes no |
duke@435 | 31 | arguments; start-debug-server-proc.sh (or -windbg.bat) takes as argument |
duke@435 | 32 | the process ID or the executable and core file names to allow remote debugging |
duke@435 | 33 | of. |
duke@435 | 34 | </p> |
duke@435 | 35 | |
duke@435 | 36 | <h3>Command line HSDB</h3> |
duke@435 | 37 | <p> |
duke@435 | 38 | There are also command line HSDB variants ("clhsdbproc.sh" or "clhsdbwindbg.bat" |
duke@435 | 39 | or 64-bit variants). There is also a JavaScript based command line interface |
duke@435 | 40 | called "jsdbproc.sh" [or "jsdbwindbg.bat" or 64-bit variants]. More details on |
duke@435 | 41 | command line interfaces can be found in |
duke@435 | 42 | <ul> |
duke@435 | 43 | <li><a href="clhsdb.html">clhsdb.html</a> |
duke@435 | 44 | <li><a href="jsdb.html">jsdb.html</a> |
duke@435 | 45 | </ul> |
duke@435 | 46 | </p> |
duke@435 | 47 | |
duke@435 | 48 | <h3>Other command line tools</h3> |
duke@435 | 49 | <p> |
duke@435 | 50 | The following table lists all SA command line tools. <xxx>windbg.bat |
duke@435 | 51 | files are for Windows. .sh files are for Solaris. <xxx>64.sh are for |
duke@435 | 52 | 64 bit debugees. |
duke@435 | 53 | </p> |
duke@435 | 54 | |
duke@435 | 55 | <table border="1"> |
duke@435 | 56 | <tr> |
duke@435 | 57 | <th> |
duke@435 | 58 | Tool |
duke@435 | 59 | </th> |
duke@435 | 60 | <th> |
duke@435 | 61 | Description |
duke@435 | 62 | </th> |
duke@435 | 63 | </tr> |
duke@435 | 64 | |
duke@435 | 65 | <tr> |
duke@435 | 66 | <td> |
duke@435 | 67 | dumpflagsproc.sh, |
duke@435 | 68 | dumpflagsproc64.sh, |
duke@435 | 69 | dumpflagswindbg.bat |
duke@435 | 70 | dumpflagswindbg64.bat |
duke@435 | 71 | </td> |
duke@435 | 72 | <td> |
duke@435 | 73 | dumps name and value of all -XX JVM command line arguments passed |
duke@435 | 74 | to debuggee. |
duke@435 | 75 | </td> |
duke@435 | 76 | </tr> |
duke@435 | 77 | |
duke@435 | 78 | <tr> |
duke@435 | 79 | <td> |
duke@435 | 80 | <a name="dumpsysprops"></a> |
duke@435 | 81 | dumpsyspropsproc.sh, |
duke@435 | 82 | dumpsyspropsproc64.sh, |
duke@435 | 83 | dumpsyspropswindbg.bat |
duke@435 | 84 | dumpsyspropswindbg64.bat |
duke@435 | 85 | </td> |
duke@435 | 86 | <td> |
duke@435 | 87 | This prints name and value of Java level System properties. |
duke@435 | 88 | </td> |
duke@435 | 89 | </tr> |
duke@435 | 90 | |
duke@435 | 91 | <tr> |
duke@435 | 92 | <td> |
duke@435 | 93 | <a name="heapdump"></a> |
duke@435 | 94 | heapdumpproc.sh, |
duke@435 | 95 | heapdumpproc64.sh, |
duke@435 | 96 | heapdumpwindbg.bat |
duke@435 | 97 | heapdumpwindbg64.bat |
duke@435 | 98 | </td> |
duke@435 | 99 | <td> |
duke@435 | 100 | Dumps heap in a file in hprof binary format. |
duke@435 | 101 | </td> |
duke@435 | 102 | </tr> |
duke@435 | 103 | |
duke@435 | 104 | <tr> |
duke@435 | 105 | <td> |
duke@435 | 106 | <a name="heapsum"></a> |
duke@435 | 107 | heapsumproc.sh, |
duke@435 | 108 | heapsumproc64.sh, |
duke@435 | 109 | heapsumwindbg.bat |
duke@435 | 110 | heapsumwindbg64.bat |
duke@435 | 111 | </td> |
duke@435 | 112 | <td> |
duke@435 | 113 | Prints summary information on Java heap. |
duke@435 | 114 | </td> |
duke@435 | 115 | </tr> |
duke@435 | 116 | |
duke@435 | 117 | |
duke@435 | 118 | <tr> |
duke@435 | 119 | <td> |
duke@435 | 120 | jcoreproc.sh, |
duke@435 | 121 | jcoreproc64.sh, |
duke@435 | 122 | jcorewindbg.bat |
duke@435 | 123 | jcorewindbg64.bat |
duke@435 | 124 | </td> |
duke@435 | 125 | <td> |
duke@435 | 126 | This can retrieve .class files from the debuggee. |
duke@435 | 127 | set the environment variable <b>JCORE_PACKAGES</b> to comman separated list of |
duke@435 | 128 | packages whose classes have to be retrieved from the core file. |
duke@435 | 129 | </td> |
duke@435 | 130 | </tr> |
duke@435 | 131 | |
duke@435 | 132 | <tr> |
duke@435 | 133 | <tr> |
duke@435 | 134 | <td> |
duke@435 | 135 | jstackproc.sh, |
duke@435 | 136 | jstackproc64.sh, |
duke@435 | 137 | jstackwindbg.bat |
duke@435 | 138 | jstackwindbg64.bat |
duke@435 | 139 | </td> |
duke@435 | 140 | <td> |
duke@435 | 141 | used to get java stack trace for all java threads. |
duke@435 | 142 | </td> |
duke@435 | 143 | </tr> |
duke@435 | 144 | |
duke@435 | 145 | <tr> |
duke@435 | 146 | <td> |
duke@435 | 147 | jhistoproc.sh, |
duke@435 | 148 | jhistoproc64.sh, |
duke@435 | 149 | jhistowindbg.bat |
duke@435 | 150 | jhistowindbg64.bat |
duke@435 | 151 | </td> |
duke@435 | 152 | <td> |
duke@435 | 153 | used to get object histogram of java heap. |
duke@435 | 154 | </td> |
duke@435 | 155 | </tr> |
duke@435 | 156 | |
duke@435 | 157 | <tr> |
duke@435 | 158 | <td> |
duke@435 | 159 | permstatproc.sh, |
duke@435 | 160 | permstatproc64.sh, |
duke@435 | 161 | permstatwindbg.bat |
duke@435 | 162 | permstatwindbg64.bat |
duke@435 | 163 | </td> |
duke@435 | 164 | <td> |
duke@435 | 165 | To gather statistics on perm. generation. |
duke@435 | 166 | </td> |
duke@435 | 167 | </tr> |
duke@435 | 168 | |
duke@435 | 169 | <a name="mixed_pstack"></a> |
duke@435 | 170 | <tr> |
duke@435 | 171 | <tr> |
duke@435 | 172 | <td> |
duke@435 | 173 | pstackproc.sh, |
duke@435 | 174 | pstackproc64.sh, |
duke@435 | 175 | pstackwindbg.bat |
duke@435 | 176 | pstackwindbg64.bat |
duke@435 | 177 | </td> |
duke@435 | 178 | <td> |
duke@435 | 179 | This 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. |
duke@435 | 180 | </td> |
duke@435 | 181 | </tr> |
duke@435 | 182 | |
duke@435 | 183 | <tr> |
duke@435 | 184 | <td> |
duke@435 | 185 | pmapproc.sh, |
duke@435 | 186 | pmapproc64.sh, |
duke@435 | 187 | pmapwindbg.bat |
duke@435 | 188 | pmapwindbg64.bat |
duke@435 | 189 | </td> |
duke@435 | 190 | <td> |
duke@435 | 191 | This is cross platform Solaris pmap-like utility. |
duke@435 | 192 | </td> |
duke@435 | 193 | </tr> |
duke@435 | 194 | |
duke@435 | 195 | <tr> |
duke@435 | 196 | <td> |
duke@435 | 197 | soqlproc.sh, |
duke@435 | 198 | soqlproc64.sh, |
duke@435 | 199 | soqlwindbg.bat |
duke@435 | 200 | soqlwindbg64.bat |
duke@435 | 201 | </td> |
duke@435 | 202 | <td> |
duke@435 | 203 | This is command line SOQL - Simple Object Query Language tool. |
duke@435 | 204 | SOQL is SQL-like query language to query Java heap. |
duke@435 | 205 | </td> |
duke@435 | 206 | <tr> |
duke@435 | 207 | <td> |
duke@435 | 208 | start-debug-server-proc.sh, |
duke@435 | 209 | start-debug-server-proc64.sh, |
duke@435 | 210 | start-debug-server-windbg.bat, |
duke@435 | 211 | start-debug-server-windbg64.bat, |
duke@435 | 212 | start-rmiregistry.bat, |
duke@435 | 213 | start-rmiregistry64.bat, |
duke@435 | 214 | start-rmiregistry.sh |
duke@435 | 215 | start-rmiregistry64.sh |
duke@435 | 216 | </td> |
duke@435 | 217 | <td> |
duke@435 | 218 | These scripts are used to run SA remotely. |
duke@435 | 219 | </td> |
duke@435 | 220 | </tr> |
duke@435 | 221 | </table> |
duke@435 | 222 | |
duke@435 | 223 | <h3>Debugging transported core dumps</h3> |
duke@435 | 224 | <p> |
duke@435 | 225 | When a core dump is moved from the machine where it was produced to a |
duke@435 | 226 | difference machine, it may not always be possible for SA to debug the same. |
duke@435 | 227 | More info. on debugging on transported core dumps is in |
duke@435 | 228 | <a href="transported_core.html">transported_core.html</a>. |
duke@435 | 229 | </p> |
duke@435 | 230 | |
duke@435 | 231 | <h3>SA Bugs</h3> |
duke@435 | 232 | <p> |
duke@435 | 233 | Not all of the possible states of target VMs have been tested (or |
duke@435 | 234 | supportable) with SA. For example, the SA will probably not work at all |
duke@435 | 235 | if it freezes the target VM during certain phases of GC. When filing bugs |
duke@435 | 236 | a pointer to a core file (see gcore(1)) which the SA can not handle well |
duke@435 | 237 | is best. |
duke@435 | 238 | </p> |
duke@435 | 239 | |
duke@435 | 240 | </body> |
duke@435 | 241 | </html> |