Obtaining garbage collection data for analysis

Garbage collection data can be collected in either one of the following two ways:

  1. Data collection with -Xverbosegc.

    Launch the Java application using the –Xverbosegc option. For more information on the option, see NSJ 11Tools Reference Pages.

  2. Data collection with Zero preparation.

    Data collection can be started from the command line by sending a signal to the Java process to indicate JVM to start GC data collection.

    To collect GC data without interrupting an already running application, perform the following from the command line:
    1. Confirm that -Xverbosegc or -Xloggc option is not specified.

    2. Locate the process ID of the running Java application.

    3. Start the profiling interval. Send a signal to the JVM by typing the following command:

      kill -ALRM pid or kill -14 pid

      The GC data is written to a file named java_pid.vgc in the current directory of the JVM process.

      Allow the profiling to continue for a desired length of time.

    4. Stop the data collection interval by sending the same signal to the JVM:

      kill -ALRM pid

    5. You can now open the saved file in the NSjmeter console and view the collected metrics.

After completing the data file collection, perform the following steps:
  1. Transfer the data file to an NSjmeter console compatible platform (HP-UX, Windows, or Linux).

  2. Run the NSjmeter console and open the data file.

NSJ supports rotational GC logging in multiple GC log files to help control the GC log file size. For information on GC log rotation, see GC log rotation.

For information on analyzing GC profile data and instructions to use NSjmeter tool, see NonStop NSjmeter 5.0 User Guide.