Tuesday, September 20, 2011

Take threaddumps, jra recording and others with a single command.

Create a file ctrlhandler.act in the weblogic domain
contents of ctrlhandler.act (For R27 Jrockit version) are
 ............................................
set_filename filename=/tmp/output.txt
print_class_summary
heap_diagnostics
print_threads
timestamp
startjrarecording recordingtime=60s filename="/tmp/robin"
stop
..................................................
  For R28 version use
start_flightrecording duration=60s filename="/tmp/robin.jfr"

For windows the command is ctrl + break on the cmd screen, where weblogic is running.
For unix, start the weblogic as . ./startweblogic.sh & and kill -3 <pid> to activate.

To find the current working directory use   ls -l /proc/<PID>/cwd 
i recommend to keep set_filename as that of current working directory.
 
ref:
http://download.oracle.com/docs/cd/E13150_01/jrockit_jvm/jrockit/geninfo/diagnos/ctrlbreakhndlr.html