Creating Fully Featured JRA Recordings with 1.4 Based JRockits (Migrated from the old BEA blog)

One of the parts of Mission Control is the JRA (the JRockit Runtime Analyzer). The JRA is a powerful profiler that can tell you a lot about the performance bottlenecks in your application whilst keeping the overhead barely noticeable.

There are new options added to the JRA recordings almost every release. In recent releases of Mission Control the JRA wizard will check what capabilities the JRockit you are attempting to start a recording on has, and present you with configurable options accordingly. The problem is that the legacy protocol used when connecting to a 1.4 version of JRockit unfortunately does not support querying for the available parameters. Do not despair; there are still means of starting JRA recordings that contain all the new goodies. This is how:

There is a neat little command line tool called jrcmd that can be found in JROCKIT_HOME/bin. The jrcmd tool can be used to invoke commands on a locally running JRockit process. It works like this:

  1. Do JROCKIT_HOME/bin/jrcmd to list the JRockit processes on your machine.
  2. Pick your favourite one and do JROCKIT_HOME/bin/jrcmd <pid> help
  3. Pick the command you wish to know more about, for example JROCKIT_HOME/bin/jrcmd <pid> help startjrarecording
  4. Invoke the command with the settings of your choice.

In this case, the command we want to use is startjrarecording, and what we want to know is what parameters we can use on a particular JRockit when issuing the startjrarecording command.

On the windows box I'm currently on, it looks like this:

D:\jrockits\R27.3.0_R27.3.0-106_1.5.0>bin\jrcmd.exe
2640 com.jrockit.mc.rcp.start.MCMain

5012 jrockit.tools.jrcmd.JrCmd

 

Notice how it lists itself. In this case I'm interested in knowing the available commands on the JRockit currently running my Mission Control (com.jrockit.mc.rcp.start.MCMain), so I do:

D:\jrockits\R27.3.0_R27.3.0-106_1.5.0>bin\jrcmd.exe 2640 help
2640:
The following commands are available:
kill_rmp_server
start_rmp_server
kill_management_server
start_management_server
checkjrarecording
stopjrarecording
startjrarecording
print_object_summary
memleakserver
print_class_summary
print_codegenlist
run_optfile
dump_codelayout
dump_codelist
dump_codemap
print_utf8pool
print_properties
print_threads
datadump_request
runsystemgc
runfinalization
heap_diagnostics
oom_diagnostics
print_exceptions
version
timestamp
command_line
memprof
sanity
verbosity
set_filename
help
print_memusage
For more information about a specific command use 'help '.
Parameters to commands are optional unless otherwise stated.

 

To find out what parameters are available to me when starting a jrarecording I do:

D:\jrockits\R27.3.0_R27.3.0-106_1.5.0>bin\jrcmd.exe 2640 help startjrarecording
2640:
Starts a JRA recording.
filename - name of the file to store JRA recording to
(string, jrarecording.xml)
recordingtime - length of the recording in seconds (int, 60)
delay - delay before starting recording in seconds (int,
0)
methodsampling - enable method sampling (bool, true)
gcsampling - enable gc information (bool, true)
heapstats - include heap statistics (bool, true)
nativesamples - include native code in sampling (bool, false)
methodtraces - include stack traces (bool, true)
tracedepth - depth of stack traces (int, 16)
sampletime - time between samples in milliseconds (int, 30)
zip - zip the recording (bool, true)
hwsampling - use hardware sampling if possible (bool, false)
threaddump - do full threaddumps at start and end of recordning
(bool, true)
threaddumpinterval - also do threaddumps every 'n' interval (can be
specified as x[ns|ms|s]) (time, 0s)
latency - include latency analysis (bool, false)
latencythreshold - do not record events shorter than this number (can
be specified as x[ns|ms|s]) (time, 20ms)
cpusamples - sample cpu usage during the recording (bool,
true)
cpusampleinterval - cpu sample interval (can be specified as
x[ns|ms|s]) (time, 1s)

 

In this case I found out that I can indeed start up a recordings with new features such as latency analysis data on this particular JVM. To actually start such a recording I could for example write:

D:\jrockits\R27.3.0_R27.3.0-106_1.5.0>bin\jrcmd.exe 2640 startjrarecording laten
cy=true latencythreshold=20ms recordingtime=120s
2640:
JRA recording started.

Comments:

Post a Comment:
Comments are closed for this entry.
About

A blog focused on JVM technology and Mission Control

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today