@@ -52,17 +52,20 @@ show-busy-java-threads
5252# 从所有运行的Java进程中找出最消耗CPU的线程(缺省5个),打印出其线程栈
5353
5454# 缺省会自动从所有的Java进程中找出最消耗CPU的线程,这样用更方便
55- # 当然你可以手动指定要分析的Java进程Id,以保证只会显示出那个你关心的Java进程的信息
55+ # 当然你可以手动指定要分析的Java进程Id,以保证只会显示出那个你关心的那个Java进程的信息
5656show-busy-java-threads -p < 指定的Java进程Id>
5757
5858show-busy-java-threads -c < 要显示的线程栈数>
5959
6060show-busy-java-threads < 重复执行的间隔秒数> [< 重复执行的次数> ]
6161# 多次执行;这2个参数的使用方式类似vmstat命令
6262
63- show-busy-java-threads -a < 输出记录到的文件 >
63+ show-busy-java-threads -a < 运行输出的记录到的文件 >
6464# 记录到文件以方便回溯查看
6565
66+ show-duplicate-java-classes -S < 存储jstack输出文件的目录>
67+ # 指定jstack输出文件的存储目录,方便记录以后续分析
68+
6669# #############################
6770# 注意:
6871# #############################
@@ -93,30 +96,36 @@ Example:
9396 show-busy-java-threads 1 # update every 1 second, (stop by eg: CTRL+C)
9497 show-busy-java-threads 3 10 # update every 3 seconds, update 10 times
9598
96- Options :
99+ Output control :
97100 -p , --pid < java pid> find out the highest cpu consumed threads from the specified java process,
98101 default from all java process.
99102 -c , --count < num> set the thread count to show, default is 5.
100103 -a , --append-file < file> specifies the file to append output as log.
101- -P, --use-ps use ps command to find busy thread(cpu usage) instead of top command,
102- default use top command, because cpu usage of ps command is expressed as
103- the percentage of time spent running during the entire lifetime of a process,
104- this is not ideal.
105- -d , --top-delay specifies the delay between top samples, default is 0.5 (second).
106- get thread cpu percentage during this delay interval.
107- more info see top -d option. eg: -d 1 (1 second).
108- -s , --jstack-path < path> specifies the path of jstack command.
109104 -S , --jstack-file-dir < path> specifies the dir for storing jstack output files, and keep files.
110105 default store jstack output files at tmp dir, and auto remove after run.
111106 use this option to keep files so as to review jstack later.
107+ delay the delay between updates in seconds.
108+ count the number of updates.
109+ delay/count arguments imitates the style of vmstat command.
110+
111+ jstack control:
112+ -s , --jstack-path < path> specifies the path of jstack command.
112113 -F, --force set jstack to force a thread dump.
113114 use when jstack < pid> does not respond (process is hung).
114115 -m, --mix-native-frames set jstack to print both java and native frames (mixed mode).
115116 -l, --lock-info set jstack with long listing. Prints additional information about locks.
117+
118+ cpu usage calculation control:
119+ -d , --top-delay specifies the delay between top samples, default is 0.5 (second).
120+ get thread cpu percentage during this delay interval.
121+ more info see top -d option. eg: -d 1 (1 second).
122+ -P, --use-ps use ps command to find busy thread(cpu usage) instead of top command,
123+ default use top command, because cpu usage of ps command is expressed as
124+ the percentage of time spent running during the entire lifetime of a process,
125+ this is not ideal.
126+
127+ Miscellaneous:
116128 -h , --help display this help and exit.
117- delay the delay between updates in seconds.
118- count the number of updates.
119- delay/count arguments imitates the style of vmstat command.
120129` ` `
121130
122131# ## 示例
0 commit comments