Files
obsidian_note/技术探究/JAVA/JVM/java 内存 排查.md
2025-12-04 09:12:56 +08:00

26 lines
895 B
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
>
刘银 11-23 09:37:15
弄下dump日志有dump日志就好分析了
杜鹏飞 11-23 09:37:28
dump日志是程序输出日志么
杜鹏飞 11-23 09:39:55
我去操作下。。
刘银 11-23 09:41:12
![](file:///E:/Documents/WXWork/1688855439456504/Cache/Image/2023-11/企业微信截图_d118f4d1-c13d-4399-ac47-c581b303a019.png)
刘银 11-23 09:41:23
启动参数加上这个,
刘银 11-23 09:41:42
挂掉后会生成dump文件。
刘银 11-23 09:42:33
dump文件直接拖到idea里面结合代码就可以看到内存占用可以分析到哪行代码。
java 进程查看
```shell
top -o %MEM -b -n 1 | grep java | awk '{print "PID: "$1" \t 虚拟内存: "$5" \t 物理内存: "$6" \t 共享内存: "$7" \t CPU使用率: "$9"% \t 内存使用率: "$10"%"}'
```
线程查看
```shell
ps p {pid} -L -o pcpu,pmem,pid,tid,time,tname,cmd
```