zoukankan      html  css  js  c++  java
  • 查找占用cpu 较高的线程

    1.top 命令 找到占用CPU高的java进程的PID

    >> 例如 pid为 146780

    2. 打出高cup的线程栈

    jstack 146780> 146780.txt

    3. 找到这个进程高cpu的线程 

    top -p 146780 -H

    >> 例如 线程号 为 105080

    4. 将线程号转化为 16进制

    printf  "%x" 105080

    >> 19a78

    4. 在146780.txt 文件中找到对应的线程

    "JobRunnerPool-thread-28" #473 prio=5 os_prio=0 tid=0x00007f86e4002800 nid=0x19a78 runnable [0x00007f87b3cfa000]
    java.lang.Thread.State: RUNNABLE
    at com.ecovacs.moa.util.MdbElinkUtil.getCompareDeptName(MdbElinkUtil.java:299)
    at com.ecovacs.moa.service.notifyelink.impl.NotifyElinkOrgDeptServiceImpl.lambda$resetDeptDataFromELink$7_aroundBody44(NotifyElinkOrgDeptServiceImpl.java:353)
    at com.ecovacs.moa.service.notifyelink.impl.NotifyElinkOrgDeptServiceImpl$AjcClosure45.run(NotifyElinkOrgDeptServiceImpl.java:1)
    at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
    at com.qbao.cat.plugin.DefaultPluginTemplate.proxyCollector(DefaultPluginTemplate.java:71)
    at com.qbao.cat.plugin.DefaultPluginTemplate.doAround(DefaultPluginTemplate.java:64)
    at com.qbao.cat.plugin.spring.SpringServicePluginTemplate.doAround(SpringServicePluginTemplate.java:31)
    at com.ecovacs.moa.service.notifyelink.impl.NotifyElinkOrgDeptServiceImpl.lambda$resetDeptDataFromELink$7(NotifyElinkOrgDeptServiceImpl.java:353)
    at com.ecovacs.moa.service.notifyelink.impl.NotifyElinkOrgDeptServiceImpl$$Lambda$39/1807707298.accept(Unknown Source)
    at java.util.ArrayList.forEach(ArrayList.java:1257)
    at com.ecovacs.moa.service.notifyelink.impl.NotifyElinkOrgDeptServiceImpl.resetDeptDataFromELink_aroundBody22(NotifyElinkOrgDeptServiceImpl.java:352)
    at com.ecovacs.moa.service.notifyelink.impl.NotifyElinkOrgDeptServiceImpl$AjcClosure23.run(NotifyElinkOrgDeptServiceImpl.java:1)
    at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
    at com.qbao.cat.plugin.DefaultPluginTemplate.proxyCollector(DefaultPluginTemplate.java:71)
    at com.qbao.cat.plugin.DefaultPluginTemplate.doAround(DefaultPluginTemplate.java:64)
    at com.qbao.cat.plugin.spring.SpringServicePluginTemplate.doAround(SpringServicePluginTemplate.java:31)
    at com.ecovacs.moa.service.notifyelink.impl.NotifyElinkOrgDeptServiceImpl.resetDeptDataFromELink(NotifyElinkOrgDeptServiceImpl.java:345)
    at com.ecovacs.moa.service.notifyelink.impl.NotifyElinkOrgDeptServiceImpl$$FastClassBySpringCGLIB$$e4da6e3.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:653)
    at com.ecovacs.moa.service.notifyelink.impl.NotifyElinkOrgDeptServiceImpl$$EnhancerBySpringCGLIB$$bf9c322b.resetDeptDataFromELink(<generated>)
    at com.ecovacs.moa.mgr.task.notifyelink.PullMdbOrgDataTask.doTask_aroundBody0(PullMdbOrgDataTask.java:38)
    at com.ecovacs.moa.mgr.task.notifyelink.PullMdbOrgDataTask$AjcClosure1.run(PullMdbOrgDataTask.java:1)
    at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
    at com.qbao.cat.plugin.DefaultPluginTemplate.proxyCollector(DefaultPluginTemplate.java:71)
    at com.qbao.cat.plugin.DefaultPluginTemplate.doAround(DefaultPluginTemplate.java:64)
    at com.qbao.cat.plugin.ecovacs.TaskPluginTemplate.doAround(TaskPluginTemplate.java:29)
    at com.ecovacs.moa.mgr.task.notifyelink.PullMdbOrgDataTask.doTask(PullMdbOrgDataTask.java:35)
    at com.ecovacs.moa.mgr.task.BaseTask.run(BaseTask.java:13)
    at com.ecovacs.moa.mgr.task.TaskManager.runTask(TaskManager.java:59)
    at com.ecovacs.moa.mgr.task.JobRunnerDispatcher.run(JobRunnerDispatcher.java:30)
    at com.github.ltsopensource.tasktracker.runner.JobRunnerDelegate.run(JobRunnerDelegate.java:86)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

    打印dump文件

    jmap -dump:format=b,file=/home/admin/logs/heap.hprof 6214

  • 相关阅读:
    安卓虚拟机启动后报错: 类似 SDK Manager] Error: Error parsing .....devices.xml 解决方案
    error when loading the sdk 发现了元素 d:skin 开头无效内容 转自http://blog.csdn.net/yueqinglkong/article/details/46340571
    mysql 5.5及以前版本的编码问题“Incorrect string value: 'xE6x9BxB9xE5x86xAC...' for column 'realname' at row 1”
    HDU 1024 Max Sum Plus Plus(基础dp)
    POJ 3026 --Borg Maze(bfs,最小生成树,英语题意题,卡格式)
    算法分类合集(转)
    ACM训练计划建议(转)
    The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple
    The 15th Zhejiang Provincial Collegiate Programming Contest Sponsored by TuSimple
    iOS消息推送机制的实现
  • 原文地址:https://www.cnblogs.com/cbliu/p/14604693.html
Copyright © 2011-2022 走看看