Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use jstack to see what Java threads are up to

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

- -1, through the top command to see java process pid

[root@m-tms-web1 logs]# top

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

4431 tms 15 0 10.5g 7.2g 15m S 6.0 61.5 756:15.88 java

- -2, split the process pid into thread pid

[root@m-tms-web1 logs]# top -Hp 4431

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

4460 tms 15 0 10.5g 7.2g 15m S 2.0 61.5 8:39.19 java

4467 tms 16 0 10.5g 7.2g 15m S 2.0 61.5 7:05.12 java

4431 tms 15 0 10.5g 7.2g 15m S 0.0 61.5 0:00.00 java

4432 tms 15 0 10.5g 7.2g 15m S 0.0 61.5 0:00.78 java

4433 tms 16 0 10.5g 7.2g 15m S 0.0 61.5 82:43.21 java

4434 tms 16 0 10.5g 7.2g 15m S 0.0 61.5 82:48.72 java

4435 tms 16 0 10.5g 7.2g 15m S 0.0 61.5 82:48.70 java

4436 tms 16 0 10.5g 7.2g 15m S 0.0 61.5 82:40.70 java

4437 tms 16 0 10.5g 7.2g 15m S 0.0 61.5 82:43.91 java

4438 tms 16 0 10.5g 7.2g 15m S 0.0 61.5 82:40.35 java

- -3, through the jstack command to see the stack information of each thread id

[root@m-tms-web1 logs]#jstack -l 4460 > out.txt

[root@m-tms-web1 logs]#jstack -F 4460 > out.txt

-l: See additional information about threads, including locked

-F: When the process has no return pending, use-F to force return thread information

See how long the 4431 process runs.

[root@m-tms-web1 logs]# ps -p 4431 -o etime

ELAPSED

1-00:36:46

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report