Issues with high CPU usage
Master some common commands jstack Jmap jps ps-ef et cetera
Top command View CPU usage PID as process number
Executive Ps-ef | grep 18201 finds a specific process
The company picture can not be disclosed, in order to replace this machine any process, this command will appear two results, the second is just executed "Ps-ef | grep 18201 "produces a
View all containers sudo docker ps-a
Enter the container sudo docker exec-it container ID bash
Use the top command again
Jstack Printing Stack Information
Sudo-u admin/xxx/java/bin/jstack-l >/localhost/stack.log
or Sudo-u admin/xxx/java/bin/jstack ' JPS |grep Bootstrap |awk ' {print $} ' >/localhost/stack.log
Note: 1. jstack requires absolute path
2.jstack is Jstack is a Java Virtual machine comes with a stack trace tool, be sure to go to the Java/bin directory to use the command
Analyze Jstack Logs
Execute TOP-H p process ID to get the specific thread ID
The thread ID is converted to 16, and the corresponding Nid is found in the Jstack log, for example nid=0x70, the thread is currently waiting on condition, and the stack information is the question of which line of code is found
- Deadlock,Deadlock (focus on)
- In execution,Runnable
- Waiting for resources,waiting on condition (focus)
- Waiting to get the monitor,waiting on Monitor entry (focus)
- Pause,Suspended
- Object Waits,object.wait () or timed_waiting
- Blocking,Blocked (Focus)
- Stop,parked .
Troubleshooting Java Daily 1