Saturday, June 12, 2010

JRockit R28 Flight Recorder (ex JRA)

Official documentation here:


http://download.oracle.com/docs/cd/E15289_01/doc.40/e15070/usingjfr.htm
entire PDF:
http://download.oracle.com/docs/cd/E15289_01/doc.40/e15070.pdf

interesting reading
http://blogs.oracle.com/jrockit/2010/04/jrockit_r28_ropsten_released.html


C:\bea11\user_projects\domains\osbdomain>jrcmd
576 jrockit.tools.jrcmd.JrCmd

3356 org.apache.derby.drda.NetworkServerControl start

1908 weblogic.Server



C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 help
1908:
The following commands are available:
kill_management_server
start_management_server
print_object_summary
memleakserver
print_class_summary
print_codeblocks
dump_codelayout
dump_codelist
dump_codemap
print_codegenlist
print_vm_state
print_utf8pool
check_flightrecording
dump_flightrecording
stop_flightrecording
start_flightrecording
print_properties
hprofdump
print_threads
datadump_request
runsystemgc
runfinalization
heap_diagnostics
oom_diagnostics
print_exceptions
version
timestamp
command_line
sanity
verbosity
set_filename
help
print_memusage
set_vmflag
list_vmflags
For more information about a specific command use 'help '.
Parameters to commands are optional unless otherwise stated.







C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 start_management_server
1908:


C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 help start_flightrecording
1908:
Starts a JFR recording
name - Name of recording (string)
settings - Settings file or preset (string)
defaultrecording - Starts default recording (bool, false)
delay - Delay recording start (time, 0s)
duration - Duration of recording (time, 0s)
filename - Resulting recording filename (string)
compress - GZip-compress the resulting recording file (bool,
false)
maxage - Maximum age of buffer data (time, 0s)
maxsize - Maximum size of buffers in bytes (long, 0)




C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 start_flightrecording duration=2m name=myfirstgeoosbrecording
1908:
Started recording 2



C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 start_flightrecording duration=2m name=myfirstgeoosbrecording2
1908:
Started recording 3


C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 check_flightrecording
1908:
Recording : id=1 name="WLDFDiagnosticImageRecording_osbdomain_AdminServer_" duration=0s dest="C:\bea11\user_projects\domains\osbdomain\servers\AdminSe
rver\logs\diagnostic_images\__tmp847859670567686703.jfr" compress=false (running)
Recording : id=2 name="myfirstgeoosbrecording" duration=120s (stopped)
Recording : id=3 name="myfirstgeoosbrecording2" duration=120s (stopped)


C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 help dump_flightrecording
1908:
Copies contents of a JFR recording to file
name - Recording name (string)
recording - Recording id (long, -1)
copy_to_file - Copy recording data to file (string)
compress_copy - GZip-compress "copy_to_file" destination (bool, false)



C:\bea11\user_projects\domains\osbdomain>jrcmd 1908 dump_flightrecording name=myfirstgeoosbrecording recording=2 copy_to_file=myfirstgeoosbrecordingf
ile.jfr compress_copy=true
1908:


C:\bea11\user_projects\domains\osbdomain>dir

Directory of C:\bea11\user_projects\domains\osbdomain
......
12-06-2010 16:53 206.158 myfirstgeoosbrecordingfile.jfr

......


Now you can open the file with JRockit Mission Control


To dump on OutOfMemoryException:
-XX:+FlightRecordingDumpOnUnhandledException

To specify a settings file (more than 1 is possible):
-XX:FlightRecorderOptions=settings=s1.jfs,settings=s2.jfs



To start recording:
jrcmd start_flightrecording settings=filename.jfs

In JROCKIT_HOME\jre\lib\jfr\default.jfs you find an example of settings.

Non-Persistent (profiling data are kept im memory only) is the default storage mode. Typically max 1 minute of history.


REMEMBER TO ENABLE THE "DIAGNOSTIC VOLUME" setting (to Low, Medium or High, but not Off) on your WebLogic server configuration, otherwise Hot Methods will not work!




No comments: