uCosminexus Application Server, Maintenance and Migration Guide

[Contents][Glossary][Index][Back][Next]

9.3.3 Outputting Statistic Information for Each Class

This subsection describes how to output the class-wise statistical information.

Use the jheapprof commands to output the class-wise statistical information to the extended thread dump. Specify the Java process, where you want to output the class-wise statistical information, and the class, where you want to output the reference-related information, and then execute the jheapprof commands.

You can specify the following when executing the jheapprof command:

The execution format and the execution example of the jheapprof command and each specification method are described as follows:

Organization of this subsection
(1) Execution format and execution example of the jheapprof command
(2) When the information of an Explicit heap is output to the class-wise statistical information
(3) When specifying whether to execute the garbage collection

(1) Execution format and execution example of the jheapprof command

The execution format and example of the jheapprof command are described below: For details about the jheapprof commands, see jheapprof (output of an extended thread dump with Hitachi class-wise statistical information) in the uCosminexus Application Server Command Reference Guide.

Execution format
In Windows
jheapprof [-f|-i] [-explicit|-noexplicit] [-class class-name] [-fullgc|-copygc|-nogc] [-garbage|-nogarbage] [-rootobjectinfo|-norootobjectinfo] [-rootobjectinfost size] -p process-ID
In UNIX
jheapprof [-f|-i] [-explicit|-noexplicit] [-class class-name] [-fullgc|-copygc|-nogc] [-garbage|-nogarbage] [-rootobjectinfo|-norootobjectinfo] [-rootobjectinfost size] [-force] -p process-ID

Execution example
Here, the class-wise statistical information of Java process with process ID 2463 is output.
  1. In the -p option, specify the process ID of the Java process where you want to output the class-wise statistical information, and then execute the jheapprof command.
    % jheapprof -p 2463
    When the -f option is being omitted in the jheapprof command, the following confirmation message is displayed:
    In Windows
    The confirmation message 'whether to output an extended thread dump with Hitachi class-wise statistical information' is displayed in the following format:
    Force VM to output HitachiJavaHeapProfile: ? (y/n)
    In UNIX
    The confirmation message of process ID is displayed in the following format:
    send SIGQUIT to 2463: ? (y/n)
  2. Enter y.
    An extended thread dump with Hitachi class-wise statistics is output. The following message is output in the running java program:
    Writing Java core to javacore2463.030806215140.txt... OK
    The running java program creates an extended thread dump with Hitachi class-wise statistics (javacore.process ID.date-time.txt) in the current directory and continues the program.

(2) When the information of an Explicit heap is output to the class-wise statistical information

If the following conditions are satisfied, you can output the information of an Explicit heap to the class-wise statistical information:

Specify the -explicit option in the jheapprof command, and then execute the command to output the information of an Explicit heap to the class-wise statistical information.

For details about the Explicit Memory Management functionality, see 8. Preventing the Occurrence of Full Garbage Collection by using the Explicit Memory Management Functionality in the uCosminexus Application Server Expansion Guide.

(3) When specifying whether to execute the garbage collection

You can select whether to execute the garbage collection before the class-wise statistical information is output. This functionality is called as pre-statistical garbage collection selection functionality. Specify any of the following options in the jheapprof command, if you want to execute the garbage collection before the class-wise statistical information is output:

For details about the pre-statistical garbage collection selection functionality, see 9.7 Pre-statistical garbage collection selection functionality. Note that you cannot execute the pre-statistical garbage collection selection functionality, when you execute the unused objects statistical functionality in the Tenured area.