Rate This Document
Findability
Accuracy
Completeness
Readability

Monitoring and Analyzing Java Applications

Command Function

Diagnoses Java applications in monitoring and analysis modes.

Syntax

  • Monitoring mode

    Monitoring events that occur in Java processes in real time:

    1
    devkit diag jvm-jitter [-h | --help] {-a monitor | --action monitor} {-e EVENT | --event EVENT} [-c | --config] {-p PID | --pid PID}
    
  • Analysis mode

    Analyzing the process information based on the collected JDK Flight Recorder (JFR) file:

    1
    devkit diag jvm-jitter [-h | --help] {-a report | --action report} {-e EVENT | --event EVENT} {-f INPUT_FILE | --file INPUT_FILE} [-o OUTPUT_PATH | --output OUTPUT_PATH]
    

Parameter Description

Table 1 Common parameters

Parameter

Option

Description

-h/--help

-

Obtains help information. This parameter is optional.

-a/--action

monitor/report

Working mode of the JVM Jitter Detector. This parameter is mandatory.

  • monitor: monitoring mode.
  • report: analysis mode.
NOTE:

When jit.deoptimization is enabled for de-optimization detection, the devkit_odin.properties file is generated in the working directory (specified by the .cfg file). You need to change the value of MONITOR_JIT in the file to true (to enable monitoring).

-e/--event

jit.deoptimization/codecache.full/all

Name of the event to be monitored or analyzed. The event can be a JIT de-optimization event or a code cache statistical event. This parameter is mandatory.

If different events are specified in the command line and configuration file, the event specified in the command line prevails.

  • jit.deoptimization: JIT de-optimization event.
  • codecache.full: code cache statistics event.
  • all: Both JIT de-optimization and code cache statistics events are monitored.
Table 2 Monitoring mode parameters

Parameter

Option

Description

-p/--pid

PID

ID of the Java process to be monitored. This parameter is mandatory.

-c/--config

kunpeng_devkit.cfg

Configuration file. The tool provides a template configuration file in the config/kunpeng_devkit.cfg directory. This parameter is optional.

Table 3 Analysis mode parameters

Parameter

Option

Description

-f/--file

-

JFR file to be analyzed. This parameter is mandatory.

-o/--output

-

Path to the generated flame graphs for JFR de-optimization events. The default path is /diag/data in the tool directory. This parameter is optional.

Parameter File Description

If the tool directory is /home/DevKit-CLI-xx.xx.xx-Linux-Kunpeng, the reference path to the configuration file is /home/DevKit-CLI-xx.xx.xx-Linux-Kunpeng/diag/config/kunpeng_devkit.cfg.

The verification file can be used to check whether the .cfg file content is correct. The verification file path is /home/DevKit-CLI-xx.xx.xx-Linux-Kunpeng/diag/config/kunpeng_devkit.xsd.

Table 4 Parameters in the kunpeng_devkit.cfg file

Parameter

Description

<jvm.DeoptimizationStatistics>

<enabled>

Indicates whether to enable event collection. The default value is false. To enable event collection, change the value to true.

<period>

Sampling interval, which defaults to 1 second. Separate the number and unit using a space. The unit can be second, minute, hour, or day (ms/s/m/h/d).

<duration>

Sampling duration, which defaults to 0 seconds (indicating non-stop sampling). Separate the number and unit using a space. The unit can be second, minute, hour, or day (ms/s/m/h/d).

<jitTraceThreshold>

Threshold for triggering fine-grained JIT event collection, which defaults to 60 (calculated by computeMode) and must be greater than 0.

<jitCollectDuration>

Sampling duration for each fine-grained JIT event collection, which defaults to 10 seconds.

<computeMode>

Method for calculating the collection threshold, which defaults to deoptimizationCount. The options are as follows:

  • deoptimizationCount: counts only the number of incremental de-optimizations.
  • compileCount: counts the number of incremental de-optimizations and the number of compilations.
  • addCount: calculates the number of incremental de-optimizations and the number of incremental compilations.

<jfrDirPath>

Path to the JFR file generated by the collection event. The devkit_odin_jfr folder is generated in the custom directory. If you do not have the directory permission, the current working directory or /tmp directory is used.

<totalJfrFileSize>

Maximum total size of all JFR files in the devkit_odin_jfr folder, in MB, which defaults to 200 MB. The value 0 indicates that the size is not limited.

<singleJfrFileSize>

Maximum size of each single JFR file, in MB, which defaults to 12 MB. The value 0 indicates that the size is not limited.

<CompilerInlining>

Adds method inlining event collection. The default value is false.

<Compilation>

Adds compilation event collection. The default value is false.

<CompilationFailure>

Adds compilation failure event collection. The default value is false.

<CompilerConfiguration>

Adds compilation configuration event collection. The default value is false.

<CompilerPhase>

Adds compilation phase event collection. The default value is false.

<JITRestart>

Adds restart event collection. The default value is false.

<jvm.CodeCacheStatistics>

<enabled>

Indicates whether to enable event collection. The default value is false. To enable event collection, change the value to true.

<period>

Sampling interval, which defaults to 1 second. Separate the number and unit using a space. The unit can be second, minute, hour, or day (ms/s/m/h/d).

<duration>

Sampling duration, which defaults to 0 seconds (indicating non-stop sampling). Separate the number and unit using a space. The unit can be second, minute, hour, or day (ms/s/m/h/d).

<codeCacheTraceThreshold>

Threshold for triggering fine-grained code cache event collection. The default value is 0.35 (percentage of code cache events to all events). The value ranges from 0 to 1.

<codeCacheAlarmThreshold>

Threshold for triggering code cache event alarms. The default value is 0.75 (percentage of code cache events to all events). The value ranges from 0 to 1.