【笔记】Java程序线程运行诊断
source link: https://loli.fj.cn/2023/01/25/Java%E7%A8%8B%E5%BA%8F%E7%BA%BF%E7%A8%8B%E8%BF%90%E8%A1%8C%E8%AF%8A%E6%96%AD/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
【笔记】Java程序线程运行诊断
2023-01-252023-01-26
在Linux下进行Java程序的线程运行诊断
查看进程运行状况
top
查看进程的所有线程
- 通过进程id查看对应的所有线程
-eo
:只查看指定字段的数据<pid>
:指定进程id
ps H -eo pid,tid,%cpu | grep <pid>
查看线程运行状态
- 通过JDK工具,查看线程的运行状态,从而定位代码位置
<pid>
:指定进程id
jstack <pid>
- 通过上一步得到的线程id(十进制),转换为十六进制数,就可以快速定位产生问题的线程所在的代码行数
Recommend
-
41
GitHub: https://github.com/google/gops 一个用于列出和诊断分析系统中正在运行的 Go 程序的命令行工具 安装 go get -u github.com/goo...
-
10
Go 运行程序中的线程数 稍微入门Go语言的程序员都知道,GOMAXPROCS变量可以限制并发运行用户态Go代码操作系统的最大线程数,你甚至可以通过调用函数func GOMAXPROCS(n int) int在程序运行时改变最大线程数的大小...
-
2
java线程池:获取运行线程数并控制线程启动速度 发表于 2017-05-26...
-
5
WordPress Hosting...
-
1
java | 线程诊断「栈」 2022-12-17...
-
7
详解JAVA线程问题诊断工具Thread Dump
-
1
Java线程诊断 - MineLSG - 博客园 1.诊断CPU占用过高 [root@master ~]# nohup java -jar...
-
2
【笔记】Java程序堆内存诊断
-
4
一次k8s docker下.net程序的异常行为dump诊断 ...
-
1
1、线程运行原理 1.1 栈与栈帧 Java Virtual Machine Stacks (Java 虚拟机栈 JVM) 我们都知道 JVM 中由堆、栈、方法区所组成,其中栈内存是给谁用的呢?其实就是线程,每个线程启动后,虚拟机就会为其分配一块栈内存。
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK