Cpu soaring windows environment issues
Taiwan online a runtime machine (windows Server) cpu alarm, this is the initial code inside an infinite loop, the first machine off the assembly line to ensure that no new assignments coming in, but still not bring the cpu usage is normal because the program does not end the cycle of death it has been running.
- Find the java process corresponding to the pid.
Method to find the pid is: open the Task Manager, and then click the "View" menu, then click "Select Columns", the pid hook, then you can see the pid value of all processes in the Task Manager. (See tool may be directly mentioned in the third step), windows10 system can directly view the details -
Export a snapshot of the Java process.
jstack -l pid > c:/31372.stack
-
Cpu utilization process can only be viewed in the windows, cpu usage To view the thread must rely on other tools, you can use Microsoft's Process Explorer (Click to go to the download page)
- Right-click the process you want to view properties
- Then select the Threads tab, locate occupy cpu thread tid
- Pid converted to hexadecimal, I have here a direct conversion system comes with a calculator, why should place the conversion, because previously exported with jstack inside information corresponding to the thread tid is hexadecimal.
- Then you can search 7C84 in the process of the exported file inside
Linux environment issues soared cpu
-
Use the following command to find the most CPU-intensive process, and then click 1, you will be shown the number of parameters and now server logical CPU server CPU. Occupy the highest standing in the front, we can see the high occupancy ava process
top -c
-
Identify high occupancy Java thread, the thread running display a list of process information, click to view the highest occupied by P
top -Hp pid
- Use JVM comes jstack command to export the current operating conditions and the current status of all threads threads, jstack tools can be used java stack and native stack information obtained core files, so you can easily know how java program is a program crashes and what problems at
jstack pid > error.log
-
Target thread turn hex pid
printf “%x\n” pid
-
Find the position after the decimal conversion error.log in pid16
grep pid error.log –color