首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >java系统问题之cpu占用过高

java系统问题之cpu占用过高

原创
作者头像
CoffeeLand
修改2020-04-07 11:21:53
修改2020-04-07 11:21:53
1K00
代码可运行
举报
文章被收录于专栏:CoffeeLandCoffeeLand
运行总次数:0
代码可运行

Table of Contents

  • Prerequisite
  • Top intro
  • Use top to find the thread information

Prerequisite

系统负载(system load)

系统负载(System Load)是系统CPU繁忙程度的度量,即有多少进程在等待被CPU调度(进程等待队列的长度)。

平均负载(Load average)

load average: 0.52, 0.27, 0.25

Load average 表示系统的cpu的平均的负载

平均负载(Load Average)是一段时间内系统的平均负载,这个一段时间一般取1分钟、5分钟、15分钟。

来自 <https://blog.csdn.net/ztf312/article/details/80342234>

Pwdx (显示进程的当前工作目录)

pwdx - report current working directory of a process

pwdx <pid>

Vim

代码语言:javascript
代码运行次数:0
运行
复制
+/{pat} 
For the first file the cursor will be positioned on the
 first occurrence of {pat}. See ":help search-pattern" for
 the available search patterns.
 
 - The file to edit is read from stdin. Commands are read from stderr, which should be a TTY.

jstack <pid>

jstack 15400 | vim +/0x3c2a -

表示直接从进程15400产生的线程stack信息, 去定位线程id是0x3c2a的线程栈信息

Top intro

实时显示系统的进程占CPU的情况, 或者是实时显示系统的负载情况

Use top to find the thread information

  • top (find the pid which has the largest cpu usage)
  • top -Hp <pid> (find the thread id )
  • Prinf "0x%x\n" <thread-id>
  • jstack <pid> | vim +/<hex_threadid> -

<hey, man or lady, 阅读完了,请点赞支持, 非常感谢:)>

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Table of Contents
  • Prerequisite
    • 系统负载(system load)
    • 平均负载(Load average)
    • Pwdx (显示进程的当前工作目录)
    • Vim
  • Top intro
  • Use top to find the thread information
  • <hey, man or lady, 阅读完了,请点赞支持, 非常感谢:)>
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档