使用 Jstack pid 打印出堆栈信息:进行初步分析:
1.没看到线程有死锁的标志。
2.通过top命令 分析。CPU确实存在异常,达到120%。初步判断是否有死循环的问题?
3.判断死循环一般会gc 很频繁。gc线程也应该大量占用cpu,ps -mp pid -o THREAD,tid,time 发现有几条玩家线程cpu占用高。
4.Jstack 打印出来。
"async-or-role-task-dispatch-5" #56 daemon prio=5 os_prio=0 tid=0x00007f4942648800 nid=0x5cd5 runnable [0x00007f48704eb000]
java.lang.Thread.State: RUNNABLE
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.siftDown(ScheduledThreadPoolExecutor.java:908)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.finishPoll(ScheduledThreadPoolExecutor.java:1055)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1085)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
"async-or-role-task-dispatch-4" #55 daemon prio=5 os_prio=0 tid=0x00007f483c003800 nid=0x5cd4 waiting on condition [0x00007f48705ec000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x000000064fe60178> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concur