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

The solution to excessive occupation of cpu by tomcat

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

Tomcat CPU usage is often encountered at work, and the following solutions are available for this situation.

jps --> View Java's progress

top -Hp pid --> According to the process number (pid) obtained by jps, view all threads of java process, and you can see all threads occupying CPU, -H is used to display all threads of a certain process.

printf "%x\n" 9733 --> Convert the thread number found in step 2 to hexadecimal for easy jstack viewing

jstack pid |grep 2605 --> 2605 is the number after converting 9733 to hexadecimal in step 3, because the thread number displayed by jstack is expressed in hexadecimal!

jstack is used to display all Java threads running, jstack pid| grep 2605 means to display only the running information of a java thread. In this way, you can display the method that this thread is running and leave it to the developer

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

Network Security

Wechat

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

12
Report