Skip to content

Commit b5396a9

Browse files
committed
JAVA 知识体系
1 parent c7b8bdb commit b5396a9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

MD/Linux.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
**查找Cpu过高查找方法**
2+
>第一步,找到占用cpu最高的一个线程
3+
方法一:top -p [pid]
4+
方法二:ps -mo spid,lwp,stime,time,%cpu -p [pid]
5+
方法三:直接top,然后shift+h
6+
>第二步,将其转化成16进制。假使我们得到的线程号为n,接下来将它转成16进制,记为spid
7+
方法一:echo "obase=64;n"|bc
8+
方法二:printf 0x%x n
9+
>下一步,执行jstack -l pid| grep spid -A 100 打印后面100行分析问题
10+
或者  Jstack -l PID >> 123.txt输出到文件后然后根据spid搜索定位问题

src/main/java/com/algorithm/study/demo/MainTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*/
88
public class MainTest {
99
public static void main(String[] args) {
10-
System.out.println(-1 << Integer.SIZE-3);
10+
while (true){
11+
12+
}
1113
}
1214
}

0 commit comments

Comments
 (0)