luxueshi bfbfeafa3a 添加 'README.md' | 3 years ago | |
---|---|---|
README.md | 3 years ago | |
show-busy-java-threads.sh | 3 years ago |
show-busy-java-threads
show-busy-java-threads -p <指定的Java进程Id>
show-busy-java-threads -c <要显示的线程栈数>
show-busy-java-threads <重复执行的间隔秒数> [<重复执行的次数>]
show-busy-java-threads -a <运行输出的记录到的文件>
show-duplicate-java-classes -S <存储jstack输出文件的目录>
##############################
##############################
sudo show-busy-java-threads
show-busy-java-threads -s <指定jstack命令的全路径>
show-busy-java-threads -m
show-busy-java-threads -F
show-busy-java-threads -l
$ show-busy-java-threads -h Usage: show-busy-java-threads [OPTION]... [delay [count]] Find out the highest cpu consumed threads of java, and print the stack of these threads.
Example: show-busy-java-threads # show busy java threads info show-busy-java-threads 1 # update every 1 second, (stop by eg: CTRL+C) show-busy-java-threads 3 10 # update every 3 seconds, update 10 times
Output control: -p, --pid find out the highest cpu consumed threads from
the specified java process, default from all java process.
-c, --count set the thread count to show, default is 5. -a, --append-file specifies the file to append output as log. -S, --store-dir specifies the directory for storing intermediate files, and keep files.
default store intermediate files at tmp dir, and auto remove after run.
use this option to keep files so as to review jstack/top/ps output later.
delay the delay between updates in seconds. count the number of updates.
delay/count arguments imitates the style of vmstat command.
jstack control: -s, --jstack-path specifies the path of jstack command. -F, --force set jstack to force a thread dump.
use when jstack <pid> does not respond (process is hung).
-m, --mix-native-frames set jstack to print both java and native frames (mixed mode). -l, --lock-info set jstack with long listing. Prints additional information about locks.
cpu usage calculation control: -d, --top-delay specifies the delay between top samples, default is 0.5 (second).
get thread cpu percentage during this delay interval.
more info see top -d option. eg: -d 1 (1 second).
-P, --use-ps use ps command to find busy thread(cpu usage) instead of top command,
default use top command, because cpu usage of ps command is expressed as
the percentage of time spent running during the *entire lifetime*
of a process, this is not ideal in general.
Miscellaneous: -h, --help display this help and exit.