bash -x show-busy-java-threads ++ basename show-busy-java-threads + readonly PROG=show-busy-java-threads + PROG=show-busy-java-threads + COMMAND_LINE=("$0" "$@") + readonly -a COMMAND_LINE ++ whoami + readonly USER=root + USER=root + readonly $'ec=\E' + ec=$'\E' + readonly 'eend=' + eend='' + uname + grep '^Linux' -q ++ getopt -n show-busy-java-threads -a -o p:c:a:s:S:Pd:Fmlh -l count:,pid:,append-file:,jstack-path:,store-dir:,use-ps,top-delay:,force,mix-native-frames,lock-info,help -- + ARGS=' --' + '[' 0 -ne 0 ']' + eval set -- ' --' ++ set -- -- + true + case "$1" in + shift + break + count=5 + update_delay=0 + '[' -z '' ']' + update_count=1 + (( update_count < 0 )) + top_delay=0.5 + use_ps=false + '[' -n '' ']' + '[' -n '' ']' + '[' -n '' ']' + which jstack + '[' -n /opt/java/openjdk ']' + '[' -f /opt/java/openjdk/bin/jstack ']' + '[' -x /opt/java/openjdk/bin/jstack ']' + jstack_path=/opt/java/openjdk/bin/jstack ++ date +%Y-%m-%d_%H:%M:%S.%N + readonly run_timestamp=2024-02-18_09:31:45.093955914 + run_timestamp=2024-02-18_09:31:45.093955914 + readonly uuid=show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407 + uuid=show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407 + readonly tmp_store_dir=/tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407 + tmp_store_dir=/tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407 + '[' -n '' ']' + readonly store_file_prefix=/tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407/2024-02-18_09:31:45.093955914_ + store_file_prefix=/tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407/2024-02-18_09:31:45.093955914_ + mkdir -p /tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407 + trap cleanupWhenExit EXIT + '[' -n '' ']' + readonly 'ps_process_select_options=-C java -C jsvc' + ps_process_select_options='-C java -C jsvc' + main + local i + (( i = 0 )) + (( update_count <= 0 || i < update_count )) + (( i > 0 )) + '[' -n '' -o -n '' ']' + (( update_count != 1 )) + false + findBusyJavaThreadsByTop + printStackOfThreads + local -a line + local idx=0 + IFS=' ' + read -a line + __top_threadId_cpu + top_cmd_line=(top -H -b -d $top_delay -n 2) + local -a top_cmd_line + __complete_pid_user_by_ps + ps_cmd_line=(ps $ps_process_select_options -wwLo pid,lwp,user --no-headers) + local -a ps_cmd_line ++ HOME=/tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407 ++ top -H -b -d 0.5 -n 2 ++ ps -C java -C jsvc -wwLo pid,lwp,user --no-headers + local -r 'ps_out= 1 1 root 1 7 root 1 8 root 1 9 root 1 10 root 1 11 root 1 12 root 1 13 root 1 14 root 1 15 root 1 16 root 1 17 root 1 18 root 1 19 root 1 20 root 1 21 root 1 22 root 1 23 root 1 24 root 1 25 root 1 26 root 1 27 root 1 28 root 1 29 root 1 30 root 1 32 root 1 33 root 1 34 root 1 35 root 1 36 root 1 38 root 1 39 root 1 40 root 1 43 root 1 45 root 1 46 root 1 47 root 1 48 root 1 49 root 1 50 root 1 51 root 1 52 root 1 53 root 1 54 root 1 55 root 1 56 root 1 57 root 1 58 root 1 65 root 1 66 root 1 67 root 1 69 root 1 86 root 1 87 root 1 166 root 1 361 root 1 363 root 1 364 root 1 365 root 1 366 root 1 367 root 1 373 root 1 376 root 1 470 root 1 477 root 1 573 root 1 1350 root 1 14840 root 1 21302 root 1 21315 root 1 21316 root 1 21320 root 1 21406 root' + '[' -n '' ']' + local idx=0 + local -a line + IFS=' ' + read -a line + local -r 'top_out=top - 09:31:45 up 66 days, 22:29, 0 users, load average: 0.27, 0.29, 0.27 Threads: 83 total, 1 running, 82 sleeping, 0 stopped, 0 zombie %Cpu(s): 1.6 us, 1.1 sy, 0.0 ni, 97.0 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 st KiB Mem : 65829456 total, 10151152 free, 28822452 used, 26855852 buff/cache KiB Swap: 0 total, 0 free, 0 used. 26211892 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.03 java 7 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:09.92 java 8 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 36:49.50 XWorker#0 9 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XUnmapper 10 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XUncommitter 11 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:27.27 XDriver 12 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 9:46.58 XDirector 13 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:32.69 XStat 14 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 RuntimeWorker#0 15 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 RuntimeWorker#1 16 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 15:58.00 VM Periodic Tas 17 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:22.61 VM Thread 18 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.05 Reference Handl 19 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Finalizer 20 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Signal Dispatch 21 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:03.29 Service Thread 22 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:58.06 Monitor Deflati 23 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:05.83 C2 CompilerThre 24 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:22.54 C1 CompilerThre 25 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.97 Common-Cleaner 26 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:56.22 PeriodicMetricR 27 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:42.68 BatchSpanProces 28 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.04 weak-ref-cleane 29 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.40 Notification Th 30 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.99 Cleaner-0 32 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.71 Apollo-ConfigSe 33 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:07.03 Apollo-RemoteCo 34 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:19.63 Apollo-RemoteCo 35 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.46 logback-1 36 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:32.59 AsyncAppender-W 38 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:55.83 okhttp-dispatch 39 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:13.22 Okio Watchdog 40 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:33.30 OkHttp otel-col 43 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:04.17 OkHttp otel-col 45 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:18.42 Apollo-SpringVa 46 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.38 Thread-4 47 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.30 nioEventLoopGro 48 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 XNIO-1 I/O-1 49 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XNIO-1 I/O-2 50 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XNIO-1 Accept 51 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:59.57 XNIO-2 I/O-1 52 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:59.55 XNIO-2 I/O-2 53 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:02.28 XNIO-2 Accept 54 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.63 AMQP Connection 55 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:07.57 pool-6-thread-2 56 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:10.90 org.springframe 57 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.01 pool-6-thread-3 58 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:20.90 XNIO-2 task-2 65 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.96 logback-2 66 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:19.28 XNIO-2 task-3 67 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.67 logback-3 69 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.84 logback-4 86 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.62 XNIO-1 task-2 87 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 pool-6-thread-4 166 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 Attach Listener 361 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-timer 363 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.03 arthas-NettyHtt 364 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-NettyWeb 365 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-NettyWeb 366 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:09.90 arthas-shell-se 367 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.54 arthas-session- 373 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.46 arthas-NettyHtt 376 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-command- 470 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:26.08 nioEventLoopGro 477 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.04 nioEventLoopGro 573 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:31.92 nioEventLoopGro 1350 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:03.40 nioEventLoopGro 14840 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:05.07 okhttp-dispatch 21302 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 OkHttp TaskRunn 21315 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21316 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21320 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21406 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Keep-Alive-Time 104 root 20 0 15380 3484 2988 S 0.0 0.0 0:00.02 bash 185 root 20 0 15408 3572 2984 S 0.0 0.0 0:00.02 sh 372 root 20 0 13052 1976 1756 S 0.0 0.0 0:00.10 telnet 21325 root 20 0 15380 3560 3072 S 0.0 0.0 0:00.02 bash 21407 root 20 0 15276 3216 2864 S 0.0 0.0 0:00.00 bash 21416 root 20 0 15276 2176 1808 S 0.0 0.0 0:00.00 bash 21417 root 20 0 15276 2116 1744 S 0.0 0.0 0:00.00 bash 21418 root 20 0 15276 2180 1808 S 0.0 0.0 0:00.00 bash 21419 root 20 0 15276 2180 1808 S 0.0 0.0 0:00.00 bash 21420 root 20 0 59608 4084 3616 R 0.0 0.0 0:00.00 top top - 09:31:45 up 66 days, 22:29, 0 users, load average: 0.27, 0.29, 0.27 Threads: 83 total, 1 running, 82 sleeping, 0 stopped, 0 zombie %Cpu(s): 2.7 us, 2.1 sy, 0.0 ni, 95.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 65829456 total, 10151152 free, 28822452 used, 26855852 buff/cache KiB Swap: 0 total, 0 free, 0 used. 26211892 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.03 java 7 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:09.92 java 8 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 36:49.50 XWorker#0 9 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XUnmapper 10 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XUncommitter 11 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:27.27 XDriver 12 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 9:46.58 XDirector 13 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:32.69 XStat 14 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 RuntimeWorker#0 15 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 RuntimeWorker#1 16 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 15:58.00 VM Periodic Tas 17 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:22.61 VM Thread 18 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.05 Reference Handl 19 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Finalizer 20 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Signal Dispatch 21 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:03.29 Service Thread 22 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:58.06 Monitor Deflati 23 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:05.83 C2 CompilerThre 24 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:22.54 C1 CompilerThre 25 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.97 Common-Cleaner 26 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:56.22 PeriodicMetricR 27 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:42.68 BatchSpanProces 28 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.04 weak-ref-cleane 29 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.40 Notification Th 30 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.99 Cleaner-0 32 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.71 Apollo-ConfigSe 33 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:07.03 Apollo-RemoteCo 34 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:19.63 Apollo-RemoteCo 35 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.46 logback-1 36 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:32.59 AsyncAppender-W 38 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:55.83 okhttp-dispatch 39 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:13.22 Okio Watchdog 40 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:33.30 OkHttp otel-col 43 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:04.17 OkHttp otel-col 45 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:18.42 Apollo-SpringVa 46 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.38 Thread-4 47 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.30 nioEventLoopGro 48 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 XNIO-1 I/O-1 49 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XNIO-1 I/O-2 50 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XNIO-1 Accept 51 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:59.57 XNIO-2 I/O-1 52 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:59.55 XNIO-2 I/O-2 53 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:02.28 XNIO-2 Accept 54 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.63 AMQP Connection 55 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:07.57 pool-6-thread-2 56 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:10.90 org.springframe 57 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.01 pool-6-thread-3 58 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:20.90 XNIO-2 task-2 65 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.96 logback-2 66 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:19.28 XNIO-2 task-3 67 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.67 logback-3 69 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.84 logback-4 86 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.62 XNIO-1 task-2 87 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 pool-6-thread-4 166 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 Attach Listener 361 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-timer 363 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.03 arthas-NettyHtt 364 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-NettyWeb 365 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-NettyWeb 366 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:09.90 arthas-shell-se 367 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.54 arthas-session- 373 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.46 arthas-NettyHtt 376 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-command- 470 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:26.08 nioEventLoopGro 477 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.04 nioEventLoopGro 573 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:31.92 nioEventLoopGro 1350 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:03.40 nioEventLoopGro 14840 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:05.07 okhttp-dispatch 21302 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 OkHttp TaskRunn 21315 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21316 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21320 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21406 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Keep-Alive-Time 104 root 20 0 15380 3484 2988 S 0.0 0.0 0:00.02 bash 185 root 20 0 15408 3572 2984 S 0.0 0.0 0:00.02 sh 372 root 20 0 13052 1976 1756 S 0.0 0.0 0:00.10 telnet 21325 root 20 0 15380 3560 3072 S 0.0 0.0 0:00.02 bash 21407 root 20 0 15276 3216 2864 S 0.0 0.0 0:00.00 bash 21416 root 20 0 15276 2176 1808 S 0.0 0.0 0:00.00 bash 21417 root 20 0 15276 2116 1744 S 0.0 0.0 0:00.00 bash 21418 root 20 0 15276 2180 1808 S 0.0 0.0 0:00.00 bash 21419 root 20 0 15276 2180 1808 S 0.0 0.0 0:00.00 bash 21420 root 20 0 59612 4184 3616 R 0.0 0.0 0:00.00 top' + '[' -n '' ']' + echo 'top - 09:31:45 up 66 days, 22:29, 0 users, load average: 0.27, 0.29, 0.27 Threads: 83 total, 1 running, 82 sleeping, 0 stopped, 0 zombie %Cpu(s): 1.6 us, 1.1 sy, 0.0 ni, 97.0 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 st KiB Mem : 65829456 total, 10151152 free, 28822452 used, 26855852 buff/cache KiB Swap: 0 total, 0 free, 0 used. 26211892 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.03 java 7 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:09.92 java 8 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 36:49.50 XWorker#0 9 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XUnmapper 10 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XUncommitter 11 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:27.27 XDriver 12 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 9:46.58 XDirector 13 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:32.69 XStat 14 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 RuntimeWorker#0 15 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 RuntimeWorker#1 16 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 15:58.00 VM Periodic Tas 17 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:22.61 VM Thread 18 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.05 Reference Handl 19 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Finalizer 20 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Signal Dispatch 21 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:03.29 Service Thread 22 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:58.06 Monitor Deflati 23 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:05.83 C2 CompilerThre 24 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:22.54 C1 CompilerThre 25 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.97 Common-Cleaner 26 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:56.22 PeriodicMetricR 27 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:42.68 BatchSpanProces 28 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.04 weak-ref-cleane 29 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.40 Notification Th 30 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.99 Cleaner-0 32 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.71 Apollo-ConfigSe 33 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:07.03 Apollo-RemoteCo 34 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:19.63 Apollo-RemoteCo 35 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.46 logback-1 36 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:32.59 AsyncAppender-W 38 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:55.83 okhttp-dispatch 39 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:13.22 Okio Watchdog 40 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:33.30 OkHttp otel-col 43 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:04.17 OkHttp otel-col 45 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:18.42 Apollo-SpringVa 46 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.38 Thread-4 47 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.30 nioEventLoopGro 48 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 XNIO-1 I/O-1 49 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XNIO-1 I/O-2 50 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XNIO-1 Accept 51 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:59.57 XNIO-2 I/O-1 52 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:59.55 XNIO-2 I/O-2 53 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:02.28 XNIO-2 Accept 54 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.63 AMQP Connection 55 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:07.57 pool-6-thread-2 56 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:10.90 org.springframe 57 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.01 pool-6-thread-3 58 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:20.90 XNIO-2 task-2 65 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.96 logback-2 66 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:19.28 XNIO-2 task-3 67 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.67 logback-3 69 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.84 logback-4 86 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.62 XNIO-1 task-2 87 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 pool-6-thread-4 166 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 Attach Listener 361 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-timer 363 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.03 arthas-NettyHtt 364 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-NettyWeb 365 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-NettyWeb 366 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:09.90 arthas-shell-se 367 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.54 arthas-session- 373 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.46 arthas-NettyHtt 376 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-command- 470 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:26.08 nioEventLoopGro 477 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.04 nioEventLoopGro 573 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:31.92 nioEventLoopGro 1350 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:03.40 nioEventLoopGro 14840 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:05.07 okhttp-dispatch 21302 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 OkHttp TaskRunn 21315 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21316 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21320 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21406 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Keep-Alive-Time 104 root 20 0 15380 3484 2988 S 0.0 0.0 0:00.02 bash 185 root 20 0 15408 3572 2984 S 0.0 0.0 0:00.02 sh 372 root 20 0 13052 1976 1756 S 0.0 0.0 0:00.10 telnet 21325 root 20 0 15380 3560 3072 S 0.0 0.0 0:00.02 bash 21407 root 20 0 15276 3216 2864 S 0.0 0.0 0:00.00 bash 21416 root 20 0 15276 2176 1808 S 0.0 0.0 0:00.00 bash 21417 root 20 0 15276 2116 1744 S 0.0 0.0 0:00.00 bash 21418 root 20 0 15276 2180 1808 S 0.0 0.0 0:00.00 bash 21419 root 20 0 15276 2180 1808 S 0.0 0.0 0:00.00 bash 21420 root 20 0 59608 4084 3616 R 0.0 0.0 0:00.00 top top - 09:31:45 up 66 days, 22:29, 0 users, load average: 0.27, 0.29, 0.27 Threads: 83 total, 1 running, 82 sleeping, 0 stopped, 0 zombie %Cpu(s): 2.7 us, 2.1 sy, 0.0 ni, 95.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st KiB Mem : 65829456 total, 10151152 free, 28822452 used, 26855852 buff/cache KiB Swap: 0 total, 0 free, 0 used. 26211892 avail Mem PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.03 java 7 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:09.92 java 8 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 36:49.50 XWorker#0 9 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XUnmapper 10 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XUncommitter 11 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:27.27 XDriver 12 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 9:46.58 XDirector 13 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:32.69 XStat 14 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 RuntimeWorker#0 15 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 RuntimeWorker#1 16 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 15:58.00 VM Periodic Tas 17 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:22.61 VM Thread 18 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.05 Reference Handl 19 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Finalizer 20 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Signal Dispatch 21 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:03.29 Service Thread 22 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:58.06 Monitor Deflati 23 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:05.83 C2 CompilerThre 24 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:22.54 C1 CompilerThre 25 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.97 Common-Cleaner 26 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:56.22 PeriodicMetricR 27 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:42.68 BatchSpanProces 28 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.04 weak-ref-cleane 29 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.40 Notification Th 30 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.99 Cleaner-0 32 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.71 Apollo-ConfigSe 33 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:07.03 Apollo-RemoteCo 34 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:19.63 Apollo-RemoteCo 35 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.46 logback-1 36 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:32.59 AsyncAppender-W 38 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:55.83 okhttp-dispatch 39 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:13.22 Okio Watchdog 40 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:33.30 OkHttp otel-col 43 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:04.17 OkHttp otel-col 45 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:18.42 Apollo-SpringVa 46 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.38 Thread-4 47 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.30 nioEventLoopGro 48 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 XNIO-1 I/O-1 49 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XNIO-1 I/O-2 50 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 XNIO-1 Accept 51 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:59.57 XNIO-2 I/O-1 52 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:59.55 XNIO-2 I/O-2 53 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:02.28 XNIO-2 Accept 54 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.63 AMQP Connection 55 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:07.57 pool-6-thread-2 56 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:10.90 org.springframe 57 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.01 pool-6-thread-3 58 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:20.90 XNIO-2 task-2 65 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.96 logback-2 66 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 2:19.28 XNIO-2 task-3 67 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.67 logback-3 69 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.84 logback-4 86 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.62 XNIO-1 task-2 87 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 pool-6-thread-4 166 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 Attach Listener 361 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-timer 363 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.03 arthas-NettyHtt 364 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-NettyWeb 365 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-NettyWeb 366 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:09.90 arthas-shell-se 367 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:01.54 arthas-session- 373 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.46 arthas-NettyHtt 376 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 arthas-command- 470 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:26.08 nioEventLoopGro 477 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:10.04 nioEventLoopGro 573 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:31.92 nioEventLoopGro 1350 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 1:03.40 nioEventLoopGro 14840 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:05.07 okhttp-dispatch 21302 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.02 OkHttp TaskRunn 21315 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21316 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21320 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 OkHttp TaskRunn 21406 root 20 0 61.4g 2.6g 2.1g S 0.0 4.1 0:00.00 Keep-Alive-Time 104 root 20 0 15380 3484 2988 S 0.0 0.0 0:00.02 bash 185 root 20 0 15408 3572 2984 S 0.0 0.0 0:00.02 sh 372 root 20 0 13052 1976 1756 S 0.0 0.0 0:00.10 telnet 21325 root 20 0 15380 3560 3072 S 0.0 0.0 0:00.02 bash 21407 root 20 0 15276 3216 2864 S 0.0 0.0 0:00.00 bash 21416 root 20 0 15276 2176 1808 S 0.0 0.0 0:00.00 bash 21417 root 20 0 15276 2116 1744 S 0.0 0.0 0:00.00 bash 21418 root 20 0 15276 2180 1808 S 0.0 0.0 0:00.00 bash 21419 root 20 0 15276 2180 1808 S 0.0 0.0 0:00.00 bash 21420 root 20 0 59612 4184 36+ awk 'BEGIN { blockIndex = 0; currentLineHasText = 0; prevLineHasText = 0; } { currentLineHasText = ($0 != "") if (prevLineHasText && !currentLineHasText) blockIndex++ # from text line to empty line, increase block index if (blockIndex == 3 && ($NF == "java" || $NF == "jsvc")) # $NF(last field) is command field # only print 4th text block(blockIndex == 3), aka. process info of second top update print $1 " " $9 # $1 is thread id field, $9 is %cpu field prevLineHasText = currentLineHasText # update prevLineHasText + sort -k2,2nr 16 R 0.0 0.0 0:00.00 top' }' + (( idx < count )) + local threadId=1 + local pcpu=0.0 ++ echo ' 1 1 root 1 7 root 1 8 root 1 9 root 1 10 root 1 11 root 1 12 root 1 13 root 1 14 root 1 15 root 1 16 root 1 17 root 1 18 root 1 19 root 1 20 root 1 21 root 1 22 root 1 23 root 1 24 root 1 25 root 1 26 root 1 27 root 1 28 root 1 29 root 1 30 root 1 32 root 1 33 root 1 34 root 1 35 root 1 36 root 1 38 root 1 39 root 1 40 root 1 43 root 1 45 root 1 46 root 1 47 root 1 48 root 1 49 root 1 50 root 1 51 root 1 52 root 1 53 root 1 54 root 1 55 root 1 56 root 1 57 root 1 58 root 1 65 root 1 66 root 1 67 root 1 69 root 1 86 root 1 87 root 1 166 root 1 361 root 1 363 root 1 364 root 1 365 root 1 366 root 1 367 root 1 373 root 1 376 root 1 470 root 1 477 root 1 573 root 1 1350 root 1 14840 root 1 21302 root 1 21315 root 1 21316 root 1 21320 root 1 21406 root' ++ awk -v threadId=1 -v pcpu=0.0 '$2==threadId { printf "%s %s %s %s\n", $1, threadId, pcpu, $3; exit }' + local 'output_fields=1 1 0.0 root' + '[' -n '1 1 0.0 root' ']' + (( idx++ )) + echo '1 1 0.0 root' + IFS=' ' + read -a line + (( idx < count )) + local pid=1 + local threadId=7 + local threadId=1 + local pcpu=0.0 ++ printf %x 1 + local threadId0x=0x1 + local pcpu=0.0 + local user=root + (( idx++ )) ++ echo ' 1 1 root 1 7 root 1 8 root 1 9 root 1 10 root 1 11 root 1 12 root 1 13 root 1 14 root 1 15 root 1 16 root 1 17 root 1 18 root 1 19 root 1 20 root 1 21 root 1 22 root 1 23 root 1 24 root 1 25 root 1 26 root 1 27 root 1 28 root 1 29 root 1 30 root 1 32 root 1 33 root 1 34 root 1 35 root 1 36 root 1 38 root 1 39 root 1 40 root 1 43 root 1 45 root 1 46 root 1 47 root 1 48 root 1 49 root 1 50 root 1 51 root 1 52 root 1 53 root 1 54 root 1 55 root 1 56 root 1 57 root 1 58 root 1 65 root 1 66 root 1 67 root 1 69 root 1 86 root 1 87 root 1 166 root 1 361 root 1 363 root 1 364 root 1 365 root 1 366 root 1 367 root 1 373 root 1 376 root 1 470 root 1 477 root 1 573 root 1 1350 root 1 14840 root 1 21302 root 1 21315 root 1 21316 root 1 21320 root 1 21406 root' + local jstackFile=/tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407/2024-02-18_09:31:45.093955914_1_jstack_1 + '[' -f /tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407/2024-02-18_09:31:45.093955914_1_jstack_1 ']' + jstack_cmd_line=("$jstack_path" ${force} $mix_native_frames $more_lock_info ${pid}) ++ awk -v threadId=7 -v pcpu=0.0 '$2==threadId { printf "%s %s %s %s\n", $1, threadId, pcpu, $3; exit }' + local -a jstack_cmd_line + '[' root == root ']' + logAndRun /opt/java/openjdk/bin/jstack 1 + echo /opt/java/openjdk/bin/jstack 1 + echo + /opt/java/openjdk/bin/jstack 1 + local 'output_fields=1 7 0.0 root' + '[' -n '1 7 0.0 root' ']' + (( idx++ )) + echo '1 7 0.0 root' + IFS=' ' + read -a line Picked up JAVA_TOOL_OPTIONS: -javaagent:/otel-auto-instrumentation-java/javaagent.jar OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended [otel.javaagent 2024-02-18 09:31:46:040 +0800] [main] INFO io.opentelemetry.javaagent.tooling.VersionLogger - opentelemetry-javaagent - version: 1.32.0 + bluePrint '[1] Busy(0.0%) thread(1/0x1) stack of java process(1) under user(root):' + colorPrint 36 '[1] Busy(0.0%) thread(1/0x1) stack of java process(1) under user(root):' + local color=36 + shift + colorEcho 36 '[1] Busy(0.0%) thread(1/0x1) stack of java process(1) under user(root):' + local color=36 + shift + '[' -t 1 ']' + echo '[1] Busy(0.0%) thread(1/0x1) stack of java process(1) under user(root):' [1] Busy(0.0%) thread(1/0x1) stack of java process(1) under user(root): + '[' -n '' -a -w '' ']' + '[' -n '' -a -w '' ']' + '[' -n '' ']' + '[' -n '' ']' + local 'sed_script=/ nid=0x1 /,/^$/ { /^$/d; p # delete end seperator line }' + sed '/ nid=0x1 /,/^$/ { /^$/d; p # delete end seperator line }' -n /tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407/2024-02-18_09:31:45.093955914_1_jstack_1 + tee + echo + IFS=' ' + read -a line + local pid=1 + local threadId=7 ++ printf %x 7 + local threadId0x=0x7 + local pcpu=0.0 + local user=root + (( idx++ )) + local jstackFile=/tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407/2024-02-18_09:31:45.093955914_1_jstack_1 + '[' -f /tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407/2024-02-18_09:31:45.093955914_1_jstack_1 ']' + bluePrint '[2] Busy(0.0%) thread(7/0x7) stack of java process(1) under user(root):' + colorPrint 36 '[2] Busy(0.0%) thread(7/0x7) stack of java process(1) under user(root):' + local color=36 + shift + colorEcho 36 '[2] Busy(0.0%) thread(7/0x7) stack of java process(1) under user(root):' + local color=36 + shift + '[' -t 1 ']' + echo '[2] Busy(0.0%) thread(7/0x7) stack of java process(1) under user(root):' [2] Busy(0.0%) thread(7/0x7) stack of java process(1) under user(root): + '[' -n '' -a -w '' ']' + '[' -n '' -a -w '' ']' + '[' -n '' ']' + '[' -n '' ']' + local 'sed_script=/ nid=0x7 /,/^$/ { /^$/d; p # delete end seperator line }' + sed '/ nid=0x7 /,/^$/ { /^$/d; p # delete end seperator line }' -n /tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407/2024-02-18_09:31:45.093955914_1_jstack_1 + tee + echo + IFS=' ' + read -a line + (( ++i )) + (( update_count <= 0 || i < update_count )) + cleanupWhenExit + rm -rf /tmp/show-busy-java-threads_2024-02-18_09:31:45.093955914_10029_21407