yiguolei opened a new pull request, #46565: URL: https://github.com/apache/doris/pull/46565
cherry-pick #38653 Issue Number: close #xxx F20240731 10:38:53.012670 20850 mem_tracker_limiter.cpp:135] mem tracker label: Query#Id=7539c7d0087442b7-a1cda6392053548a, consumption: 52, peak consumption: 1155332, mem tracker not equal to 0 when mem tracker destruct, this usually means that memory tracking is inaccurate and SCOPED_ATTACH_TASK and SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER are not used correctly. 1. For query and load, memory leaks may have occurred, it is expected that the query mem tracker will be bound to the thread context using SCOPED_ATTACH_TASK and SCOPED_SWITCH_THREAD_MEM_TRACKER_LIMITER before all memory alloc and free. 2. If a memory alloc is recorded by this tracker, it is expected that be recorded in this tracker when memory is freed. 3. Merge the remaining memory tracking value by this tracker into Orphan, if you observe that Orphan is not equal to 0 in the mem tracker web or log, this indicates that there may be a memory leak. 4. If you need to transfer memory tracking value between two trackers, can use transfer_to..[Address Sanitizer]: 0x606002867d80, size 52, strack trace: 0# Allocator::alloc_impl(unsigned long, unsigned long) 1# void* phmap::priv::Allocate<4ul, doris::vectorized::Allocator_ >(doris::vectorized::Allocator_*, unsigned long) 2# phmap::priv::raw_hash_set, phmap::Hash, phmap::EqualTo, doris::vectorized::Allocator_ >::initialize_slots(unsigned long) 3# phmap::priv::raw_hash_set, phmap::Hash, phmap::EqualTo, doris::vectorized::Allocator_ >::resize(unsigned long) 4# phmap::priv::raw_hash_set, phmap::Hash, phmap::EqualTo, doris::vectorized::Allocator_ >::prepare_insert(unsigned long) 5# std::pair phmap::priv::raw_hash_set, phmap::Hash, phmap::EqualTo, doris::vectorized::Allocator_ >::find_or_prepare_insert(int const&, unsigned long) 6# std::pair, phmap::Hash, phmap::EqualTo, doris::vectorized::Allocator_ >::iterator, bool> phmap::priv::raw_hash_set, phmap::Hash, phmap::EqualTo, doris::vectorized::Allocator_ >::emplace_decomposable(int const&, unsigned long, int const&) 7# std::pair, phmap::Hash, phmap::EqualTo, doris::vectorized::Allocator_ >::iterator, bool> phmap::priv::raw_hash_set, phmap::Hash, phmap::EqualTo, doris::vectorized::Allocator_ >::EmplaceDecomposable::operator()(int const&, int const&) const 8# doris::HybridSet<(doris::PrimitiveType)5, doris::DynamicContainer, doris::vectorized::ColumnVector >::insert(void const*) 9# doris::HybridSetBase::insert(doris::HybridSetBase*) 10# doris::RuntimePredicateWrapper::merge(doris::RuntimePredicateWrapper const*) 11# doris::IRuntimeFilter::merge_from(doris::RuntimePredicateWrapper const*) 12# doris::RuntimeFilterMergeControllerEntity::merge(doris::PMergeFilterRequest const*, butil::IOBufAsZeroCopyInputStream*) 13# doris::FragmentMgr::merge_filter(doris::PMergeFilterRequest const*, butil::IOBufAsZeroCopyInputStream*) 14# std::_Function_handler::_M_invoke(std::_Any_data const&) 15# doris::WorkThreadPool::work_thread(int) 16# execute_native_thread_routine 17# ? 18# ? ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org