使用jrcmd来开始JRockit JVM的飞行记录

首先使用jps -mlv来查询正在运行的java 进程, jps命令在%java_home%/bin下可以找到。

使用jrcmd来启动飞行记录,示例如下,可以指定文件名,recording的名字以及持续时间
jrcmd 8756 start_flightrecording filename=c:\temp\xujin.jfr name=temp duration=5m 

详细参数说明如下:


Argument Description

compress: true

Directs the Flight Recorder to gzip the .jfr file on the disk.The default value is false.

defaultrecording: true

Enables a default recording. The default value is false.

delay

Sets the amount of time to elapse during run time before starting the recording.

duration

Sets the amount of time for the recording to run.

filename

Sets the name of the flight recording log file. This file will have the extension .jfr.

maxage

For time-bound recordings, sets the maximum amount of time a recording can last before that recording is flushed from the thread buffer to the global buffer.

maxsize

For size-bound recordings, sets the maximum size of a recording before that recording is flushed from the thread buffer to the global buffer.

name

Sets a recording identifier.

settings

Identifies the event settings file to use for the recording.



在记录过程中也可以使用check_flightrecording来查看状态,如下:

C:\Oracle\JDK\JRockit64\bin>jrcmd 8756 check_flightrecording
8756:
Recording : id=4 name="temp" duration=300s dest="c:\temp\xujin.jfr" compress=false (running)


也可以使用stop_flightrecording来停止一个飞行记录,如下:
jrcmd 8756 stop_flightrecording id=3
jrcmd 8756 stop_flightrecording name=temp






你可能感兴趣的:(使用jrcmd来开始JRockit JVM的飞行记录)