arthas icon indicating copy to clipboard operation
arthas copied to clipboard

dashboard 命令cpuUsage长期在90%左右

Open wanqiu410 opened this issue 1 year ago • 0 comments

  • [ ] 我已经在 issues 里搜索,没有重复的issue。

环境信息

  • arthas-boot.jar 或者 as.sh 的版本: 3.5.0
  • Arthas 版本: 3.7.2
  • 操作系统版本: CentOS Linux release 7.9.2009 (Core)
  • 目标进程的JVM版本: 1.8.0_211
  • 执行arthas-boot的版本: 3.5.0

重现问题的步骤

执行arthas的dashboard,cpu占用比较高(执行thread -n 3,对应的线程也很耗cpu)

期望的结果

执行dashboard对cpu影响不大

实际运行的结果

实际执行dashboard命令时,cpu占比长期稳定在90%左右,如果有执行thread -n 3,则这2命令总共消耗cpu的和也是90%左右

实际运行结果如下: 执行dashboard情况截图 image 执行thread -n 3的截图 image

执行thread -n 3的结果 [arthas@31]$ thread -n 3 "Timer-for-arthas-dashboard-8439bd86-4fd0-48aa-8798-7613367af6b9" Id=364141 cpuUsage=49.84% deltaTime=5098ms time=23414ms RUNNABLE at sun.management.ThreadImpl.getThreadTotalCpuTime0(Native Method) at sun.management.ThreadImpl.getThreadCpuTime(ThreadImpl.java:267) at sun.management.ThreadImpl.getThreadCpuTime(ThreadImpl.java:226) at com.taobao.arthas.core.command.monitor200.ThreadSampler.sample(ThreadSampler.java:84) at com.taobao.arthas.core.command.monitor200.DashboardCommand$DashboardTimerTask.original$run$method$renamed$by$ttl(DashboardCommand.java:242) at com.taobao.arthas.core.command.monitor200.DashboardCommand$DashboardTimerTask.run(DashboardCommand.java) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505)

"arthas-command-execute" Id=328160 cpuUsage=46.73% deltaTime=4779ms time=44801ms RUNNABLE at sun.management.ThreadImpl.dumpThreads0(Native Method) at sun.management.ThreadImpl.getThreadInfo(ThreadImpl.java:448) at com.taobao.arthas.core.command.monitor200.ThreadCommand.processTopBusyThreads(ThreadCommand.java:206) at com.taobao.arthas.core.command.monitor200.ThreadCommand.process(ThreadCommand.java:122) at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.process(AnnotatedCommandImpl.java:82) at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl.access$100(AnnotatedCommandImpl.java:18) at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:111) at com.taobao.arthas.core.shell.command.impl.AnnotatedCommandImpl$ProcessHandler.handle(AnnotatedCommandImpl.java:108) at com.taobao.arthas.core.shell.system.impl.ProcessImpl$CommandProcessTask.run(ProcessImpl.java:385) at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:60) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) 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)

把异常信息贴到这里

wanqiu410 avatar Feb 06 '24 05:02 wanqiu410