baidu / braft

An industrial-grade C++ implementation of RAFT consensus algorithm based on brpc, widely used inside Baidu to build highly-available distributed systems.
Apache License 2.0
3.99k stars 886 forks source link

内存飙升 #353

Open GOGOYAO opened 2 years ago

GOGOYAO commented 2 years ago

线上服务会在某个时刻突然内存飙升,导致内存打满。日志上会有如下提示。怀疑是braft的某个环节,因为某些原因,导致bthread大量创建。

5260 E0224 23:52:16.908337 46573 stack.cpp:114, allocate_stack_storage] Fail to mprotect 0x7fa015580000 length=4096: Cannot allocate memory [12]
5261 E0224 23:52:17.104514 46598 stack.cpp:97, allocate_stack_storage] Fail to mmap size=1052672 stack_count=31740, possibly limited by /proc/sys/vm/max_map_count: Cannot allocate memory [12]

求指导下 @PFZheng @chenzhangyi

PFZheng commented 2 years ago

brpc的内存分析页面看了吗

GOGOYAO commented 2 years ago

brpc的内存分析页面看了吗

这个没法看。瞬间就飙升了。抓不到那个点。