[branch-2.1](memory) Refactor LRU cache policy memory tracking#37658
Merged
HappenLee merged 3 commits intoapache:branch-2.1from Jul 11, 2024
Merged
[branch-2.1](memory) Refactor LRU cache policy memory tracking#37658HappenLee merged 3 commits intoapache:branch-2.1from
HappenLee merged 3 commits intoapache:branch-2.1from
Conversation
Debug CacheManager::_caches unordered_map multithreaded visibility.
Fix apache#35590, CacheManager get CachePolicy should be used lock. Add LRUCachePolicyTrackingAllocator and LRUCachePolicyTrackingManual. tracking memory in LRUCachePolicy::insert, LRUCacheValueBase not need init mem_tracker, so not need to get CachePolicy under lock.
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
Contributor
Author
|
run buildall |
…ption (apache#35965) add conf enable_stacktrace_in_allocator_check_failed, if true, allocator check failed log stacktrace if not catch exception ``` I20240606 16:10:05.376622 3763531 allocator.cpp:109] Query:e35a88cfda634e66-b8664c46ff06b58a waiting for enough memory in thread id:140604421146368, maximum 1000ms, Allocator sys memory check failed: Cannot alloc:4096, consuming tracker:<Query#Id=e35a88cfda634e66-b8664c46 ff06b58a>, peak used 1178636808, current used 919127432, exec node:<>, process memory used 4.61 GB exceed limit 3.01 GB or sys available memory 145.57 GB less than low water mark 1.60 GB. Alloc Stacktrace: 0# Allocator<false, false, false>::sys_memory_check(unsigned long) const at /mnt/disk2/liyifan/doris/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/basic_string.h:1946 1# Allocator<false, false, false>::alloc_impl(unsigned long, unsigned long) at /mnt/disk2/liyifan/doris/core/be/src/vec/common/allocator.cpp:197 2# doris::FunctionContext::FunctionContext() at /mnt/disk2/liyifan/doris/core/be/src/vec/common/arena.h:62 3# doris::FunctionContext::create_context(doris::RuntimeState*, doris::TypeDescriptor const&, std::vector<doris::TypeDescriptor, std::allocator<doris::TypeDescriptor> > const&) at /mnt/disk2/liyifan/doris/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../ ../include/c++/11/bits/unique_ptr.h:155 4# doris::FunctionContext::clone() at /mnt/disk2/liyifan/doris/core/be/src/udf/udf.cpp:57 5# doris::vectorized::VExprContext::clone(doris::RuntimeState*, std::shared_ptr<doris::vectorized::VExprContext>&) at /mnt/disk2/liyifan/doris/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/vector.tcc:112 6# doris::pipeline::PipelineXLocalState<doris::pipeline::FakeSharedState>::open(doris::RuntimeState*) at /mnt/disk2/liyifan/doris/core/be/src/common/status.h:492 7# doris::pipeline::ScanLocalState<doris::pipeline::OlapScanLocalState>::open(doris::RuntimeState*) at /mnt/disk2/liyifan/doris/core/be/src/common/status.h:492 8# doris::pipeline::PipelineTask::_open() at /mnt/disk2/liyifan/doris/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/tuple:180 9# doris::pipeline::PipelineTask::execute(bool*) at /mnt/disk2/liyifan/doris/core/be/src/common/status.h:492 10# doris::pipeline::TaskScheduler::_do_work(unsigned long) at /mnt/disk2/liyifan/doris/core/be/src/common/status.h:388 11# doris::ThreadPool::dispatch_thread() at /mnt/disk2/liyifan/doris/core/be/src/util/threadpool.cpp:0 12# doris::Thread::supervise_thread(void*) at /mnt/disk2/liyifan/doris/ldb_toolchain/bin/../usr/include/pthread.h:562 13# start_thread 14# __clone ```
Contributor
Author
|
run buildall |
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
1 similar comment
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
|
TeamCity be ut coverage result: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pick
#36235
#35965