java.rst
changeset 1848 17256527f85e
parent 1847 1333ab54cab1
child 1905 fba288d59662
equal deleted inserted replaced
1847:1333ab54cab1 1848:17256527f85e
   180 
   180 
   181 and then attach with debugger::
   181 and then attach with debugger::
   182 
   182 
   183   $ jdb -attach $PORT
   183   $ jdb -attach $PORT
   184 
   184 
       
   185 Creating thread dump.
       
   186 =====================
       
   187 
   185 Dump current thread traces and memory statistic to stdout::
   188 Dump current thread traces and memory statistic to stdout::
   186 
   189 
   187   $ kill -QUIT $PID
   190   $ kill -QUIT $PID
       
   191 
       
   192 If application started with ``nohup`` redirect output to selected file::
       
   193 
       
   194   $ nohup java -cp ... com.app.Main  >$NOHUP.log &
       
   195 
       
   196 or check default ``nohup.out`` or ``$HOME/nohup.out`` file.
       
   197 
       
   198 Alternatively use ``jstack`` utility for Java version 1.5 and above::
       
   199 
       
   200   $ jstack -l $PID  >$DUMP.out
       
   201 
       
   202 ``jstack`` should be runned from same user as probing application::
       
   203 
       
   204   $ sudo -u $USER jstack -l $PID  >$DUMP.out
       
   205 
       
   206 .. NOTE:: Thread information preserved in heap dump and can be reviewed in
       
   207           ``visualvm``.
   188 
   208 
   189 Creating heap dump from Java application.
   209 Creating heap dump from Java application.
   190 =========================================
   210 =========================================
   191 
   211 
   192 Find pid of Java process::
   212 Find pid of Java process::