GreatSQL社区

搜索

[讨论中] mysql 8.0.27 疑似内存泄露,问题,我额外的4g内存去哪里了?

301 3 2024-1-9 10:04
top 观察:使用24GB


free 显示使用25GB



sql语句查询显示小时20g





zabbix 监控显示内存一直在持续下降中,上次因为内存消耗较高直接oom 了





全部回复(3)
yejr 2024-1-9 11:14:45
用任意搜索引擎,提交搜索关键字
site:greatsql.cn 内存 泄漏 OOM

即可搜到以前相关讨论帖内容
jian.tang 2024-1-9 15:34:55
yejr 发表于 2024-1-9 11:14
用任意搜索引擎,提交搜索关键字
site:greatsql.cn 内存 泄漏 OOM

确认了,应该就是内存泄露了。已经通过gdb --batch --pid 8954 --ex 'call malloc_trim(0)'
释放了5g内存,
pstack 看如下:
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95cde2 in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#0  0x00007eff3b95ca35 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
yejr 2024-1-9 16:48:57
jian.tang 发表于 2024-1-9 15:34
确认了,应该就是内存泄露了。已经通过gdb --batch --pid 8954 --ex 'call malloc_trim(0)'
释放了5g内 ...

建议升级到GreatSQL 8.0.32-25版本,并且安装jemalloc替代glibc默认的内存分配管理器。
https://greatsql.cn/docs/8032-25 ... nstall-prepare.html
jian.tang

4

主题

0

博客

16

贡献

新手上路

Rank: 1

积分
25

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-5-7 11:15 , Processed in 0.038385 second(s), 14 queries , Redis On.
快速回复 返回顶部 返回列表