当前位置:网站首页>cpu飙升排查方法
cpu飙升排查方法
2022-07-03 14:41:00 【一一可可】
1先来一段飙升代码
public class FindJavaThreadInTaskManager {
public static void main(String[] args) {
Thread thread = new Thread(new Worker());
thread.start();
}
static class Worker implements Runnable {
@Override
public void run() {
while (true) {
System.out.println("Thread Name:" + Thread.currentThread().getName());
}
}
}
}
2 、将程序打成jar包 t1.jar
3 、放到linux服务器上运行jar包方法
java -cp t1.jar test1.FindJavaThreadInTaskManager
4、找到CPU利用率持续比较高的进程,获取进程号,此处PID为5735

5、top -Hp 5735

6、将pid转成16进制
printf %x 5747 =======》1673
7、查看当前线程的堆栈信息
./jstack 5735 |grep -A 200 1673

边栏推荐
- Zzuli:1045 numerical statistics
- NOI OPENJUDGE 1.5(23)
- [opengl] face pinching system
- 数学常数表 by q779
- NOI OPENJUDGE 1.3(06)
- Zzuli:1059 highest score
- Thread. Sleep and timeunit SECONDS. The difference between sleep
- Puzzle (016.4) domino effect
- Tonybot humanoid robot infrared remote control play 0630
- 牛客 BM83 字符串变形(大小写转换,字符串反转,字符串替换)
猜你喜欢

C language DUP function

Tiantu investment sprint Hong Kong stocks: asset management scale of 24.9 billion, invested in xiaohongshu and Naixue

Introduction to opengl4.0 tutorial computing shaders

Sub GHz wireless solution Z-Wave 800 Series zg23 SOC and zgm230s modules

MySQL multi table query subquery

如何查询淘宝天猫的宝贝类目
![[graphics] efficient target deformation animation based on OpenGL es 3.0](/img/53/852ac569c930bc419846ac209c8d47.jpg)
[graphics] efficient target deformation animation based on OpenGL es 3.0

Sword finger offer 28 Symmetric binary tree

Tailing rushes to the scientific and Technological Innovation Board: it plans to raise 1.3 billion, and Xiaomi Changjiang is the shareholder

PS tips - draw green earth with a brush
随机推荐
tonybot 人形機器人 紅外遙控玩法 0630
从书本《皮囊》摘录的几个句子
ZABBIX saves the page blank after adding calculated items
adc128s022 ADC verilog设计实现
Niuke bm83 string deformation (case conversion, string inversion, string replacement)
Get permissions dynamically
Zzuli:1040 sum of sequence 1
【7.3】146. LRU缓存机制
Zzuli:1052 sum of sequence 4
How to query the baby category of tmall on Taobao
Four data flows and cases of grpc
To improve efficiency or increase costs, how should developers understand pair programming?
Container of symfony
如何查询淘宝天猫的宝贝类目
Rasterization: a practical implementation (2)
光猫超级账号密码、宽带账号密码 获取
Puzzle (016.4) domino effect
7-10 stack of hats (25 points) (C language solution)
Etcd cluster permission management and account password usage
Output student grades