[fix](memory) Fix memory leak by calling boost::stacktrace (#14269)
boost::stacktrace::stacktrace() has memory leak, so use glog internal func to print stacktrace. The reason for the memory leak of boost::stacktrace is that a state is saved in the thread local of each thread but not actively released. The test found that each thread leaked about 100M after calling boost::stacktrace. refer to: boostorg/stacktrace#118 boostorg/stacktrace#111
This commit is contained in:
@ -25,6 +25,11 @@ void DumpStackTraceToString(std::string* stacktrace);
|
||||
|
||||
namespace doris {
|
||||
|
||||
// `boost::stacktrace::stacktrace()` has memory leak, so use the glog internal func to print stacktrace.
|
||||
// The reason for the boost::stacktrace memory leak is that a state is saved in the thread local of each
|
||||
// thread but is not actively released. Refer to:
|
||||
// https://github.com/boostorg/stacktrace/issues/118
|
||||
// https://github.com/boostorg/stacktrace/issues/111
|
||||
std::string get_stack_trace() {
|
||||
std::string s;
|
||||
google::glog_internal_namespace_::DumpStackTraceToString(&s);
|
||||
|
||||
Reference in New Issue
Block a user