The CPU is 100% certain to be deadlocked, this time to observe the memory is still enough, but the CPU has been 100%, the following steps to solve:

1. Find the process that consumes the most CPU

$Top Top - :: Up days, :, user, Load Average: 0.75, 0.60, 0.53 Tasks: Total, running, sleeping, Stopped, Zombie Cpu(s): Sy us 11.6%, 7.0%, 0.0% ni, 81.3% id, wa, 0.0%, 0.0% hi 0.0% si, 0.1% st Mem: 8388608k total, 8381460k used, 7148k free, 0k buffers Swap: 1999864k total, 0k used, 1999864k free, 4089340k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND admin - 5631m .0g 102m S : javaCopy the code

2. Thread occupation in the process:

$top -p  -H
top - :: up  days, :,   user,  load average: 0.63, 0.59, 0.54
Tasks:  total,    running,  sleeping,    stopped,    zombie
Cpu(s):  0.7%us,  0.3%sy,  0.0%ni, 98.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.2%st
Mem:   8388608k total,  8382160k used,     6448k free,        0k buffers
Swap:  1999864k total,        0k used,  1999864k free,  4089636k cached
 
   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 admin       - 5631m .0g 102m S  :21.02 java
 admin       - 5631m .0g 102m S  :56.39 javaCopy the code

3. Dump file:

$ jstack  > Desktop/jstack.logCopy the code

4. Find the hexadecimal corresponding PID of step #2

$printf %x
269d6Copy the code

Dump = 0x269d6 = 0x269d6

zhangdeMacBook-Air:~ zhang$ more Desktop/jstack.log 2016-07-17 11:45:20 Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.79 - b02 mixed mode) : "Attach Listener" daemon prio=5 tid=0x00007f9aab82a800 nid=0x580b waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE daemon prio = 5 "SocketConnectorIoProcessor - 0.2" tid = 0 x00007f9aab43b800 nid = 0 x7003 RUNNABLE x00000001699a4000 [0] java.lang.Thread.State: RUNNABLE at sun.nio.ch.KQueueArrayWrapper.kevent0(Native Method) at sun.nio.ch.KQueueArrayWrapper.poll(KQueueArrayWrapper.java:200) at sun.nio.ch.KQueueSelectorImpl.doSelect(KQueueSelectorImpl.java:103) at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87) - locked <0x00000001585a8078> (a sun.nio.ch.Util$2) - locked <0x00000001585a8088> (a java.util.Collections$UnmodifiableSet) - locked <0x00000001585a8028> (a sun.nio.ch.KQueueSelectorImpl) at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98) at org.apache.mina.transport.socket.nio.SocketIoProcessor$Worker.run(SocketIoProcessor.java:480) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:51) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)Copy the code

6. Analyze the cause of the problem with dump and code, and generally find the cause

[Java] CPU 100% cause finding solutions to more related articles

  1. Java ConcurrentModificationException abnormal reason and solution

    Java ConcurrentModificationException abnormal reason and solution Mentioned in an article in front of the Vector. The ArrayList if to be modified at the same time when I was in the iteration will be thrown Java. U…

  2. Concurrent Java programming: Java ConcurrentModificationException abnormal reason and solution

    Java ConcurrentModificationException abnormal reason and solution Mentioned in an article in front of the Vector. The ArrayList if to be modified at the same time when I was in the iteration will be thrown Java. U…

  3. [go] Java ConcurrentModificationException abnormal reason and solution

    The original web site: http://www.cnblogs.com/dolphin0520/p/3933551.html Java ConcurrentModificationException abnormal reasons and solutions…

  4. What Linux Java CPU 100%?

    [bin]# toptop-16:56:14 up 119 days, 6:17, 7 Users, Load Average: 2.04, 2.07, 2….

  5. linux java cpu 100%

    [bin]# toptop-16:56:14 up 119 days, 6:17, 7 Users, Load Average: 2.04, 2.07, 2….

  6. W3wp. exe(IIS) CPU usage of 100% common causes and solutions

    W3wp.exe (IIS) occupies 100% of the CPU. W3wp.exe (IIS) occupies 100% of the CPU.

  7. Common causes and optimization of SQL Server Cpu 100%

    It is not common for SQL Server Cpu to reach 100%. The common cause of PERFORMANCE problems in SQL Server is blocking. Number of connections IO disks Therefore, the general USAGE of SQL Server is relatively low. But,…

  8. Atitit. Why Java system development efficiency is so low and solve

    MVC <> WebForm Server control Ajax <> WebForm Server control Ajax <>…

  9. [Opportunity] How to solve the problem of high CPU usage such as Java for Citrix virtual desktops

    How can I solve the problem that Citrix virtual desktop has a high CPU usage such as Java? Problem 1: Java clients have a large impact on the CPU usage of virtual desktops. However, some users need to use programs supported by Java. Question 2: For its…

Random recommended

  1. Create a new tag in OsChina Git

    I submitted the code to the trunk today. I wanted to tag it. Because I created a new tag before, but I don’t know where to put it when I create it now. I couldn’t find it anywhere. Look for information from the net also have no, look for customer service nobody reason me, see a communication…

  2. ABP source code analysis forty-one: ZERO Audit,Setting,Background Job

    AuditLog: Entity class that inherits from Entity< Long >. Encapsulate the AuditLog information. AuditingStore: implements the IAuditingStore interface, and implements the AuditLog letter…

  3. Record a Quartz2D learning (2)

    (a) is mainly about the line drawing and drawing state of preservation and restoration This is some graphic illustration 2 drawings of 2.1 triangle map drawing three lines: (is) – (void) drawRect: (CGRect) the rect…

  4. The relationship between tomcat-root and Webapps, some issues about deployment

    Phenomenon: before encountered a very strange problem, after the version of no effect, the page or read the previous version. Repeatedly find reason found http://localhost:8080/mobie page is normal under this path, and http://lo.

  5. GreenDAO3 is used for basic purposes

    GreenDAO3 basically uses greenDAO3 to define entity classes in the way that greenDAO3 starts with annotations and generates the code by installing gradle plug-ins. Previous versions created a separate Java-lib project to store the generated files…

  6. MOTION-MATCHING IN UBISOFT’s FOR HONOR translation

    http://www.gameanim.com/2016/05/03/motion-matching-ubisofts-honor/ Introducing For Honor with a vide …

  7. Android data format parsing object JSON

    The focus of the inside address: http://www.cnblogs.com/devinzhang/archive/2012/01/09/2317315.html: case (1) parsing JSON parsing Object…

  8. Python basics — Getting object information

    Python basics — Getting Object Information How we know what type an object is when we get a reference to it. What are the methods? First, we determine the type of the object, using the type() function: basic types can use type(…

  9. SQL2005 transactions and locking (9

    ———————————————————————— — Author : HappyFlyStone – …

  10. Lingo does linear programming – Asset Allocation and Portfolio Models

    Reference: <An Introduction to Management Science Quantitative Approaches to Decision Making, Rev …