Because it's been being monitored for a while, but the work is still in progress.
Because the machine is not many, so this morning patrol, saw a production machine on the high CPU
Top
And then you get out of the great God tool JVM
Introduction to the specific JVM look: http://www.cnblogs.com/smail-bao/p/6027756.html
If the CPU is high, we're using jstack tools.
First we use top to find out which process is causing the CPU to soar high
Here we see a process with PID number 11506
What is the project for this process (in order to send the wrong location to the relevant developer), using Ps-aux | grep PID
But how do we target specific threads or code?
The list of threads is displayed first:
PS-MP Pid-o Thread,tid,time
From here we can find the highest consuming thread 11508, which takes up more than a minute of CPU time.
Here we then convert the thread's TID to 16, using the following method
printf "%x\n" tid
From here we can see that the hexadecimal corresponding to the thread is 2CF4
Last print thread's stack information:
Jstack PID | grep tid-a100
And then we send this piece of content to the corresponding development, and he can locate his problem.
Finally, summarize the methods and techniques for troubleshooting CPU failures:
1. Top command: Linux command. You can view real-time CPU usage. You can also view CPU usage for the most recent period of time.
2, PS command: Linux command. Powerful process status monitoring commands. You can view the current CPU usage of the process and threads in the process. The sampled data that belongs to the current state.
3, the Jstack:java provides the command. You can view the current thread stack run of a process. Depending on the output of this command, you can locate the current running state of all threads of a process, run code, deadlock, and so on.
4, Pstack:linux command. You can view the current thread stack run of a process.
Article turned from: http://blog.csdn.net/blade2001/article/details/9065985
Java Process CPU Soar high