6

性能调优-内存泄露的排查方法

 2 years ago
source link: https://mikeygithub.github.io/2022/09/01/yuque/qmcirn/
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.
neoserver,ios ssh client

性能调优-内存泄露的排查方法 - 麦奇

性能调优-内存泄露的排查方法 _
Mikey 2022年9月1日 晚上

272 字

3 分钟

4 次

image.png

image.png

内存泄露的定义

内存泄漏(Memory Leak)是指程序中已动态分配的堆内存由于某种原因程序未释放或无法释放,造成系统内存的浪费,导致程序运行速度减慢甚至系统崩溃等严重后果。

  • top 命令查看服务器负载

  • jstack

利用 jstack -l 查看那些 cpu 使用率过高的线程,看是否大多数是 gc 线程,如果是说明 gc 过于频繁,而且耗时过长,导致应用线程被挂起,无法响应客户端发来的请求,这种情况就应该是内存泄露的问题了。

相关工具:https://mikeygithub.github.io/2021/07/22/yuque/rdphy6/


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK