Hitachi

Hitachi Application Server V10 Command Reference Guide (For UNIX® Systems)


4.2.9 jheapprofanalyzer

CSV output of class-wise statistical information analysis file

Synopsis

jheapprofanalyzer [-J option-name] [file-name]

Storage location

Application Server installation directory/jdk/jre/bin/

Function

This command uses multiple extended thread dump files (with statistics by class) as input, and outputs the total size of instances by class and number of instances by class in chronological order. The output file is a CSV file.

When you use the statistics-by-class analysis function, you can output only statistics of instances whose total sizes are large, and check the memory usage only for these instances. To output only instances whose total sizes are large, execute the jheapprofanalyzer command and specify a threshold for -DJP.co.Hitachi.soft.jvm.tools.jheapprofanalyzer.threshold.

Files

Extended thread dump file with statistics by class (javacoreprocess-ID.date-and-time.txt)

Arguments

-J option-name

You can specify the following options in option-name. Also, when you specify options excluding the following options, the operation is not guaranteed:

  • -Xms

    Specify the initial size of the memory allocation pool in number of bytes.

  • -Xmx

    Specify the maximum size of memory allocation pool in number of bytes.

  • -DJP.co.Hitachi.soft.jvm.tools.jheapprofanalyzer.threshold=num

    num: Specifies the threshold value of the instance total size. The range is from 0 to 263-1 (Long.MAX_VALUE). Only the classes where the instance total size is more than num are output.

    Default value: 1024

File name

You can specify the extended thread dump file containing the class-wise statistical information. There are no special rules for specifying file names. Moreover, you can specify the files in any order without any limitations on the file count.

Output format

The following explains the input file, output file, and output format of the statistics-by-class analysis function.

Input files

The extended thread dump files in which the class-wise statistical information is output are used as the input files in the class-wise statistical information analysis functionality.

Output files

The files output in the class-wise statistical information analysis functionality include two types of files, such as files that output the total instance size of each class and files that output the number of instances of each class. The output files are created in the current directory with the following names.

Type of output file

Example of output file name

Instance total size file

JheapprofAnalyzer_size_nnn.csv

Instance count file

JheapprofAnalyzer_num_nnn.csv

Legend:

nnn: The file segmentation number is output. The segmentation number is in the range of 001 to 999.

The output file is segmented when the number of columns exceeds 201. When the number of files exceeds 999, the count returns to 001 and files are re-written.

When the number of columns at which segmentation is performed exceeds 201 (1 column for class name + 200 columns for value), the output format is the same for the segmented file as well.

Output format

The following table shows the output format of the files output in the class-wise statistical information analysis file.

Note that the output format of the CSV file in which the total instance size and number of instances are output is also the same.

The first column is the class name. The maximum number of input file names is 200 (columns).

class name,

input file name,

input file name,

...

input file name,

class name,

value-1-1,

value-1-2,

...

value-1-xxx

:

:

:

...

:

class name,

value-y-1,

value-y-2,

...

value-y-xxx

Legend:

input file name: Indicates the statistics by class specified as the processing target.

class name: Indicates the class name output in the input file.

value: Indicates the total instance size or number of instances.

Demarcate a class name and value, and a value from another value with a comma. End a line with a value (including a blank).

Class names are output in a random order. Based on the date displayed as the value in the first row of an input file, the input files are arranged side by side starting from the file with the oldest date. If input files with the same date exist, they are connected randomly and arranged side by side.

Reference note

If you execute the class-wise statistical information analysis functionality more than once, classes might be removed or added during processing. Also, 0 will be output as the value when the corresponding class does not exist. The following figure shows the class information.

First class-wise statistical information (A.txt)

Second class-wise statistical information (B.txt)

Third class-wise statistical information (C.txt)

ClassA    100
ClassB    100

ClassA    100
ClassB     30
ClassC     50
ClassD      0
ClassA    100

ClassC     50

For the class information above, if 0 is specified for the threshold in -DJP.co.Hitachi.soft.jvm.tools.jheapprofanalyzer.threshold, the following result is output:

class name,A.txt,B.txt,C.txt
ClassA, 100,100, 100
ClassB, 100, 30, 0
ClassC, 0, 50, 50
ClassD, 0, 0, 0

The maximum value of total instance size is 0 to 263-1, and the maximum value of the number of instances is 0 to 231-1. If the same class name exists in an input file, the total instance size is added. The number of instances is also added. If the respective maximum values are exceeded due to adding up, the specified maximum value is output. Note that if the corresponding class information does not exist in all input files of a class or if the threshold value is not reached, the information of that class is not output.

Examples

jheapprofanalyzer -J-Xms1024m -J-Xmx1024m -J-DJP.co.Hitachi.soft.jvm.tools.jheapprofanayzer.threshold=5000 javacore22356.080523161703.txt javacore22356.080523161711.txt

Exit Status

Exit Status

Explanation

0

The command is terminated normally.

1

The command is terminated abnormally.

Output message

If any of the following error or warning message is output, the statistics-by-class analysis file is not output. If other error messages are output, the default exception processing is performed.

No.

Error message

Explanation

Operation after output

1

usage: jheapprofanalyzer [options] file...where options include:-J-Xms<size> set initial Java heap size-J-Xmx<size> set maximum Java heap size-J-DJP.co.Hitachi.soft.jvm.tools.jheapprofanalyzer.threshold=<num> set instance total size threshold

An argument specified for the JheapprofAnalyzer class is invalid.

(a)

2

JheapprofAnalyzer: Illegal property valuenum. Default is assumed.

A value other than an integer is specified in num of JP.co.Hitachi.soft.jvm.tools.jheapprofanalyzer.threshold or the num is out of range.

(b)

3

JheapprofAnalyzer: can't open input filefile-name

file-name does not exist in the directory or the file does not open due to some other factors.

(c)

4

JheapprofAnalyzer: can't read input filefile-name

Failed in loading file-name

(c)

5

JheapprofAnalyzer: Illegal input file formatfile-name

file-name is not an extended thread dump file containing the class-wise statistical information.

(c)

6

JheapprofAnalyzer: can't open output filefile-name

Unable to open the output file. The following status can be considered as the reasons for error:

  • The output file is changed to a directory.

  • There is no output file.

  • Unable to open the output file due to some other reasons.

(a)

7

JheapprofAnalyzer: can't write output filefile-name

Failed in writing file-name.

(a)

Legend:

(a): The process ends abnormally.

(b): Continues executing the process assuming the default value.

(c): Continues the process and checks the error of all the specified input files.

Notes

In the class-wise statistical information analysis functionality, the file is opened only when the date is acquired and when data is loaded. Therefore, the result is not guaranteed for updating and deleting the input data, when the command is being executed.