This topic created in 1261 days ago, the information mentioned may be changed or developed.
大概有 600w 的业务订单数据
服务启动后内存一直在增加,最终服务器上能占用 120G 。之后就稳定下来了
通过 valgrind 跑的话没发现内存泄漏的问题,但是最终占用也基本是 120 多 G 是一样的。
有没有什么办法 能分析到究竟是程序哪里开辟和占用的过高呢?
9 replies • 2022-12-05 10:57:17 +08:00
 |
|
2
imggyyll Dec 2, 2022
jemalloc 或者 tcmalloc 的 profile 功能,也可以看看 /proc/pid/smaps
|
 |
|
3
jones2000 Dec 2, 2022
使用自己的内存池, 所有内存分配都走自己的内存池。内存池里面的内存块头上加点信息,好定位内存使用的地方,然后就打印信息,慢慢找了。
|
 |
|
4
litmxs Dec 2, 2022 via Android
Google Perf Tools
|
 |
|
5
litmxs Dec 2, 2022 via Android
这么大的内存不知道 profile 工具能不能跑起来,最好能定位到小点的模块后单独抽出来做 profile
|
 |
|
6
noErr Dec 2, 2022
能调试的话,就很方便了,运行一会,diff 一下内存
|
 |
|
9
theniupa Dec 5, 2022
linux 环境?试试 malloc_trim?
|