Jump to Content
  Previous Next
Content starts here

Creating a Recording

There are several ways to start a JRA recording:

Note: If you are running Mission Control on a Windows system, you need to be a member of the Administrators or the Performance Logs user groups to be able to create a JRA recording. The typical error message, for not being part of either of these groups, can look like this:
[perf ] Failed to init virtual size counter:
To start a recording within Mission Control
  1. Start your Java application with JRockit and add the -Xmanagement option to the command line.
  2. Start the JRockit Browser and connect to the JRockit instance you just started.
  3. Make sure that your application is running and is under load.
  4. If you run the application without load, the data captured from that application will not show where there is room for improvements.

  5. Click the Start JRA recording button.
  6. The JRA Recording dialog box appears (Figure 3-1).

    Figure 3-1 JRA Recording Dialog Box


     JRA Recording Dialog Box

  7. Type a descriptive name for the recording in the File name field.
  8. The file is created in the current directory of the BEA JRockit process, unless you specify a different path. If an old file already exists, it will be overwritten by the new recording.

  9. Set a time for the length of the recording (in seconds).
  10. Note: If you set a time that is too short, e.g. shorter than 30 seconds, you will probably not get enough sample data for the recording to be meaningful.
  11. Select none, one, or all of the following sampling options:
    • Use GC sampling-records garbage collection events
    • Use method sampling-records samples of methods
    • Use native sampling-records samples of native code
    • The Selected JRockits field displays which JRockit you will create your recording from.

  12. Click Finish.
  13. The JRA recording progress window appears. When the recording is finished, it loads in the JRA tool.

To start a recording with jrcmd
  1. Make sure that your application is running and is under load.
  2. If you run the application without stress, the data captured from that application will not show where there is room for improvements.

  3. Use one of the following commands to initiate a recording:
  4. Windows platforms:

    bin\jrcmd.exe <pid> jrarecording time=<jrarecording time> filename=<filename>

    Unix platforms:

    bin/jrcmd <pid> jrarecording time=<jrarecording time> filename=<filename>

    Where the arguments are:

    • jrarecording time-the duration of the recording in seconds (a good length is 300 seconds, i.e., five minutes).
    • filename-the name of the file you want to save the recording to (for example jrarecording.xml.zip). The file will be created in the current directory of the JRockit process. It will be overwritten if it already exists.
    • For example:
      bin\jrcmd.exe <pid> jrarecording time=300 filename=c:\temp\jra.xml.zip
      Starts a JRA recording of 300s and stores the result in the specified file.

      After the recording is initiated, BEA JRockit prints a message indicating that the recording has started. When the recording is done, it will print another message; it is now safe to shut down your application.

Starting a Recording from the JRockit Command Line

Use the -XXjra command in combination with an option listed in Table 3-1, for example, -XXjra:recordingtime to specify the duration of the recording.

Table 3-1 Command Line Startup Options
Option
Description
delay
Amount of time, in seconds, to wait before recording starts.
recordingtime
Duration, in seconds, for the recording. This is an optional parameter. If you don't use it, the default is 60 seconds)
filename
The name of recording file. This is an optional parameter. If you don't use it, the default is jrarecording.xml.
sampletime
The time, in milliseconds, between samples. Do not use this parameter unless you are familiar with how it works. This is an optional parameter.
nativesamples
Displays method samples in native code; that is, you will see the names of functions written in C-code. This is an optional parameter.
methodtraces
You can set this to false to disable the stack trace collection that otherwise happens for each sample. The default value is true.
tracedepth
Sets the number of frames that will be captured when collecting stack traces. Possible value are 0 through 16. The default value is 16.

Note: Setting methodtraces to false can still result in some stack traces being captured. These stack traces are captured as part of JRockit's dynamic optimizations and will have a depth of 3. If optimizations are turned off (-Xnoopt) these traces will not be captured.

You can view the startup options that you have set in the JRA recording, see Viewing VM Arguments Information. Listing 3-1 shows an example of how you can setup a JRA recording.

Listing 3-1 An example of using the -XXjra startup command:
-XXjra:delay=10,recordingtime=100,filename=jrarecording2.xml

would result in a recording that:

About JRA Overhead when Recording

The overhead while recording is very low-typically less than two percent. However, since JRA is forcing a full garbage collection at the beginning and at the end of the recording to generate the heap histogram data, there may be a spike at the beginning and at the end of a recording.

  Previous Next