Fix memory leak by calling in mem hook (#12708)
After the consume mem tracker exceeds the mem limit in the mem hook, the boost stacktrace will be printed. A query/load will only be printed once, and the process tracker will only be printed once per second. After the process memory reaches the upper limit, the boost stacktrace will be printed every second. The observed phenomena are as follows: After query/load is canceled, the memory increases instantly; tcmalloc profile total physical memory is less than perf process memory; The process mem tracker is smaller than the perf process memory;
This commit is contained in:
@ -213,7 +213,8 @@ void MemTrackerLimiter::print_log_usage(const std::string& msg) {
|
||||
} else {
|
||||
detail += "\n" + log_usage();
|
||||
}
|
||||
detail += "\n" + boost::stacktrace::to_string(boost::stacktrace::stacktrace());
|
||||
// TODO: memory leak by calling `boost::stacktrace` in mem hook
|
||||
// detail += "\n" + boost::stacktrace::to_string(boost::stacktrace::stacktrace());
|
||||
LOG(WARNING) << detail;
|
||||
_print_log_usage = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user