be/src/core/allocator.cpp
Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | |
18 | | #include "core/allocator.h" |
19 | | |
20 | | #include <glog/logging.h> |
21 | | |
22 | | #include <atomic> |
23 | | // IWYU pragma: no_include <bits/chrono.h> |
24 | | #include <chrono> // IWYU pragma: keep |
25 | | #include <memory> |
26 | | #include <new> |
27 | | #include <random> |
28 | | #include <thread> |
29 | | |
30 | | // Allocator is used by too many files. For compilation speed, put dependencies in `.cpp` as much as possible. |
31 | | #include "common/compiler_util.h" |
32 | | #include "common/status.h" |
33 | | #include "runtime/memory/global_memory_arbitrator.h" |
34 | | #include "runtime/memory/jemalloc_control.h" |
35 | | #include "runtime/memory/memory_reclamation.h" |
36 | | #include "runtime/memory/thread_mem_tracker_mgr.h" |
37 | | #include "runtime/process_profile.h" |
38 | | #include "runtime/thread_context.h" |
39 | | #include "util/mem_info.h" |
40 | | #include "util/pretty_printer.h" |
41 | | #include "util/stack_util.h" |
42 | | #include "util/uid_util.h" |
43 | | |
44 | | namespace doris { |
45 | | std::unordered_map<void*, size_t> RecordSizeMemoryAllocator::_allocated_sizes; |
46 | | std::mutex RecordSizeMemoryAllocator::_mutex; |
47 | | |
48 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
49 | | bool check_and_tracking_memory> |
50 | | bool Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
51 | | check_and_tracking_memory>::sys_memory_exceed(size_t size, |
52 | 2.86M | std::string* err_msg) const { |
53 | 2.86M | #ifdef BE_TEST |
54 | 2.86M | if (!doris::pthread_context_ptr_init) { |
55 | 20.3k | return false; |
56 | 20.3k | } |
57 | 2.84M | #endif |
58 | 2.84M | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { |
59 | 0 | return false; |
60 | 0 | } |
61 | | |
62 | 2.84M | if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { |
63 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); |
64 | | // Only thread attach task, and has not completely waited for thread_wait_gc_max_milliseconds, |
65 | | // will wait for gc. otherwise, if the outside will catch the exception, throwing an exception. |
66 | 0 | *err_msg += fmt::format( |
67 | 0 | "Allocator sys memory check failed: Cannot alloc:{}, consuming " |
68 | 0 | "tracker:<{}>, peak used {}, current used {}, reserved {}, exec node:<{}>, {}.", |
69 | 0 | doris::PrettyPrinter::print_bytes(size), |
70 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), |
71 | 0 | doris::PrettyPrinter::print_bytes( |
72 | 0 | thread_mem_ctx->limiter_mem_tracker()->peak_consumption()), |
73 | 0 | doris::PrettyPrinter::print_bytes( |
74 | 0 | thread_mem_ctx->limiter_mem_tracker()->consumption()), |
75 | 0 | doris::PrettyPrinter::print_bytes( |
76 | 0 | thread_mem_ctx->limiter_mem_tracker()->reserved_consumption()), |
77 | 0 | thread_mem_ctx->last_consumer_tracker_label(), |
78 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str()); |
79 | |
|
80 | 0 | if (doris::config::stacktrace_in_alloc_large_memory_bytes > 0 && |
81 | 0 | size > doris::config::stacktrace_in_alloc_large_memory_bytes) { |
82 | 0 | *err_msg += "\nAlloc Stacktrace:\n" + doris::get_stack_trace(); |
83 | 0 | } |
84 | 0 | return true; |
85 | 0 | } |
86 | 2.84M | return false; |
87 | 2.84M | } _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 52 | 4 | std::string* err_msg) const { | 53 | 4 | #ifdef BE_TEST | 54 | 4 | if (!doris::pthread_context_ptr_init) { | 55 | 0 | return false; | 56 | 0 | } | 57 | 4 | #endif | 58 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 59 | 0 | return false; | 60 | 0 | } | 61 | | | 62 | 4 | if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 63 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 64 | | // Only thread attach task, and has not completely waited for thread_wait_gc_max_milliseconds, | 65 | | // will wait for gc. otherwise, if the outside will catch the exception, throwing an exception. | 66 | 0 | *err_msg += fmt::format( | 67 | 0 | "Allocator sys memory check failed: Cannot alloc:{}, consuming " | 68 | 0 | "tracker:<{}>, peak used {}, current used {}, reserved {}, exec node:<{}>, {}.", | 69 | 0 | doris::PrettyPrinter::print_bytes(size), | 70 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 71 | 0 | doris::PrettyPrinter::print_bytes( | 72 | 0 | thread_mem_ctx->limiter_mem_tracker()->peak_consumption()), | 73 | 0 | doris::PrettyPrinter::print_bytes( | 74 | 0 | thread_mem_ctx->limiter_mem_tracker()->consumption()), | 75 | 0 | doris::PrettyPrinter::print_bytes( | 76 | 0 | thread_mem_ctx->limiter_mem_tracker()->reserved_consumption()), | 77 | 0 | thread_mem_ctx->last_consumer_tracker_label(), | 78 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str()); | 79 | |
| 80 | 0 | if (doris::config::stacktrace_in_alloc_large_memory_bytes > 0 && | 81 | 0 | size > doris::config::stacktrace_in_alloc_large_memory_bytes) { | 82 | 0 | *err_msg += "\nAlloc Stacktrace:\n" + doris::get_stack_trace(); | 83 | 0 | } | 84 | 0 | return true; | 85 | 0 | } | 86 | 4 | return false; | 87 | 4 | } |
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 52 | 844 | std::string* err_msg) const { | 53 | 844 | #ifdef BE_TEST | 54 | 844 | if (!doris::pthread_context_ptr_init) { | 55 | 0 | return false; | 56 | 0 | } | 57 | 844 | #endif | 58 | 844 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 59 | 0 | return false; | 60 | 0 | } | 61 | | | 62 | 844 | if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 63 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 64 | | // Only thread attach task, and has not completely waited for thread_wait_gc_max_milliseconds, | 65 | | // will wait for gc. otherwise, if the outside will catch the exception, throwing an exception. | 66 | 0 | *err_msg += fmt::format( | 67 | 0 | "Allocator sys memory check failed: Cannot alloc:{}, consuming " | 68 | 0 | "tracker:<{}>, peak used {}, current used {}, reserved {}, exec node:<{}>, {}.", | 69 | 0 | doris::PrettyPrinter::print_bytes(size), | 70 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 71 | 0 | doris::PrettyPrinter::print_bytes( | 72 | 0 | thread_mem_ctx->limiter_mem_tracker()->peak_consumption()), | 73 | 0 | doris::PrettyPrinter::print_bytes( | 74 | 0 | thread_mem_ctx->limiter_mem_tracker()->consumption()), | 75 | 0 | doris::PrettyPrinter::print_bytes( | 76 | 0 | thread_mem_ctx->limiter_mem_tracker()->reserved_consumption()), | 77 | 0 | thread_mem_ctx->last_consumer_tracker_label(), | 78 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str()); | 79 | |
| 80 | 0 | if (doris::config::stacktrace_in_alloc_large_memory_bytes > 0 && | 81 | 0 | size > doris::config::stacktrace_in_alloc_large_memory_bytes) { | 82 | 0 | *err_msg += "\nAlloc Stacktrace:\n" + doris::get_stack_trace(); | 83 | 0 | } | 84 | 0 | return true; | 85 | 0 | } | 86 | 844 | return false; | 87 | 844 | } |
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 52 | 4 | std::string* err_msg) const { | 53 | 4 | #ifdef BE_TEST | 54 | 4 | if (!doris::pthread_context_ptr_init) { | 55 | 0 | return false; | 56 | 0 | } | 57 | 4 | #endif | 58 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 59 | 0 | return false; | 60 | 0 | } | 61 | | | 62 | 4 | if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 63 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 64 | | // Only thread attach task, and has not completely waited for thread_wait_gc_max_milliseconds, | 65 | | // will wait for gc. otherwise, if the outside will catch the exception, throwing an exception. | 66 | 0 | *err_msg += fmt::format( | 67 | 0 | "Allocator sys memory check failed: Cannot alloc:{}, consuming " | 68 | 0 | "tracker:<{}>, peak used {}, current used {}, reserved {}, exec node:<{}>, {}.", | 69 | 0 | doris::PrettyPrinter::print_bytes(size), | 70 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 71 | 0 | doris::PrettyPrinter::print_bytes( | 72 | 0 | thread_mem_ctx->limiter_mem_tracker()->peak_consumption()), | 73 | 0 | doris::PrettyPrinter::print_bytes( | 74 | 0 | thread_mem_ctx->limiter_mem_tracker()->consumption()), | 75 | 0 | doris::PrettyPrinter::print_bytes( | 76 | 0 | thread_mem_ctx->limiter_mem_tracker()->reserved_consumption()), | 77 | 0 | thread_mem_ctx->last_consumer_tracker_label(), | 78 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str()); | 79 | |
| 80 | 0 | if (doris::config::stacktrace_in_alloc_large_memory_bytes > 0 && | 81 | 0 | size > doris::config::stacktrace_in_alloc_large_memory_bytes) { | 82 | 0 | *err_msg += "\nAlloc Stacktrace:\n" + doris::get_stack_trace(); | 83 | 0 | } | 84 | 0 | return true; | 85 | 0 | } | 86 | 4 | return false; | 87 | 4 | } |
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 52 | 22.2k | std::string* err_msg) const { | 53 | 22.2k | #ifdef BE_TEST | 54 | 22.2k | if (!doris::pthread_context_ptr_init) { | 55 | 300 | return false; | 56 | 300 | } | 57 | 21.9k | #endif | 58 | 21.9k | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 59 | 0 | return false; | 60 | 0 | } | 61 | | | 62 | 21.9k | if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 63 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 64 | | // Only thread attach task, and has not completely waited for thread_wait_gc_max_milliseconds, | 65 | | // will wait for gc. otherwise, if the outside will catch the exception, throwing an exception. | 66 | 0 | *err_msg += fmt::format( | 67 | 0 | "Allocator sys memory check failed: Cannot alloc:{}, consuming " | 68 | 0 | "tracker:<{}>, peak used {}, current used {}, reserved {}, exec node:<{}>, {}.", | 69 | 0 | doris::PrettyPrinter::print_bytes(size), | 70 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 71 | 0 | doris::PrettyPrinter::print_bytes( | 72 | 0 | thread_mem_ctx->limiter_mem_tracker()->peak_consumption()), | 73 | 0 | doris::PrettyPrinter::print_bytes( | 74 | 0 | thread_mem_ctx->limiter_mem_tracker()->consumption()), | 75 | 0 | doris::PrettyPrinter::print_bytes( | 76 | 0 | thread_mem_ctx->limiter_mem_tracker()->reserved_consumption()), | 77 | 0 | thread_mem_ctx->last_consumer_tracker_label(), | 78 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str()); | 79 | |
| 80 | 0 | if (doris::config::stacktrace_in_alloc_large_memory_bytes > 0 && | 81 | 0 | size > doris::config::stacktrace_in_alloc_large_memory_bytes) { | 82 | 0 | *err_msg += "\nAlloc Stacktrace:\n" + doris::get_stack_trace(); | 83 | 0 | } | 84 | 0 | return true; | 85 | 0 | } | 86 | 21.9k | return false; | 87 | 21.9k | } |
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 52 | 4 | std::string* err_msg) const { | 53 | 4 | #ifdef BE_TEST | 54 | 4 | if (!doris::pthread_context_ptr_init) { | 55 | 0 | return false; | 56 | 0 | } | 57 | 4 | #endif | 58 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 59 | 0 | return false; | 60 | 0 | } | 61 | | | 62 | 4 | if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 63 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 64 | | // Only thread attach task, and has not completely waited for thread_wait_gc_max_milliseconds, | 65 | | // will wait for gc. otherwise, if the outside will catch the exception, throwing an exception. | 66 | 0 | *err_msg += fmt::format( | 67 | 0 | "Allocator sys memory check failed: Cannot alloc:{}, consuming " | 68 | 0 | "tracker:<{}>, peak used {}, current used {}, reserved {}, exec node:<{}>, {}.", | 69 | 0 | doris::PrettyPrinter::print_bytes(size), | 70 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 71 | 0 | doris::PrettyPrinter::print_bytes( | 72 | 0 | thread_mem_ctx->limiter_mem_tracker()->peak_consumption()), | 73 | 0 | doris::PrettyPrinter::print_bytes( | 74 | 0 | thread_mem_ctx->limiter_mem_tracker()->consumption()), | 75 | 0 | doris::PrettyPrinter::print_bytes( | 76 | 0 | thread_mem_ctx->limiter_mem_tracker()->reserved_consumption()), | 77 | 0 | thread_mem_ctx->last_consumer_tracker_label(), | 78 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str()); | 79 | |
| 80 | 0 | if (doris::config::stacktrace_in_alloc_large_memory_bytes > 0 && | 81 | 0 | size > doris::config::stacktrace_in_alloc_large_memory_bytes) { | 82 | 0 | *err_msg += "\nAlloc Stacktrace:\n" + doris::get_stack_trace(); | 83 | 0 | } | 84 | 0 | return true; | 85 | 0 | } | 86 | 4 | return false; | 87 | 4 | } |
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 52 | 4 | std::string* err_msg) const { | 53 | 4 | #ifdef BE_TEST | 54 | 4 | if (!doris::pthread_context_ptr_init) { | 55 | 0 | return false; | 56 | 0 | } | 57 | 4 | #endif | 58 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 59 | 0 | return false; | 60 | 0 | } | 61 | | | 62 | 4 | if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 63 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 64 | | // Only thread attach task, and has not completely waited for thread_wait_gc_max_milliseconds, | 65 | | // will wait for gc. otherwise, if the outside will catch the exception, throwing an exception. | 66 | 0 | *err_msg += fmt::format( | 67 | 0 | "Allocator sys memory check failed: Cannot alloc:{}, consuming " | 68 | 0 | "tracker:<{}>, peak used {}, current used {}, reserved {}, exec node:<{}>, {}.", | 69 | 0 | doris::PrettyPrinter::print_bytes(size), | 70 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 71 | 0 | doris::PrettyPrinter::print_bytes( | 72 | 0 | thread_mem_ctx->limiter_mem_tracker()->peak_consumption()), | 73 | 0 | doris::PrettyPrinter::print_bytes( | 74 | 0 | thread_mem_ctx->limiter_mem_tracker()->consumption()), | 75 | 0 | doris::PrettyPrinter::print_bytes( | 76 | 0 | thread_mem_ctx->limiter_mem_tracker()->reserved_consumption()), | 77 | 0 | thread_mem_ctx->last_consumer_tracker_label(), | 78 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str()); | 79 | |
| 80 | 0 | if (doris::config::stacktrace_in_alloc_large_memory_bytes > 0 && | 81 | 0 | size > doris::config::stacktrace_in_alloc_large_memory_bytes) { | 82 | 0 | *err_msg += "\nAlloc Stacktrace:\n" + doris::get_stack_trace(); | 83 | 0 | } | 84 | 0 | return true; | 85 | 0 | } | 86 | 4 | return false; | 87 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 52 | 4 | std::string* err_msg) const { | 53 | 4 | #ifdef BE_TEST | 54 | 4 | if (!doris::pthread_context_ptr_init) { | 55 | 0 | return false; | 56 | 0 | } | 57 | 4 | #endif | 58 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 59 | 0 | return false; | 60 | 0 | } | 61 | | | 62 | 4 | if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 63 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 64 | | // Only thread attach task, and has not completely waited for thread_wait_gc_max_milliseconds, | 65 | | // will wait for gc. otherwise, if the outside will catch the exception, throwing an exception. | 66 | 0 | *err_msg += fmt::format( | 67 | 0 | "Allocator sys memory check failed: Cannot alloc:{}, consuming " | 68 | 0 | "tracker:<{}>, peak used {}, current used {}, reserved {}, exec node:<{}>, {}.", | 69 | 0 | doris::PrettyPrinter::print_bytes(size), | 70 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 71 | 0 | doris::PrettyPrinter::print_bytes( | 72 | 0 | thread_mem_ctx->limiter_mem_tracker()->peak_consumption()), | 73 | 0 | doris::PrettyPrinter::print_bytes( | 74 | 0 | thread_mem_ctx->limiter_mem_tracker()->consumption()), | 75 | 0 | doris::PrettyPrinter::print_bytes( | 76 | 0 | thread_mem_ctx->limiter_mem_tracker()->reserved_consumption()), | 77 | 0 | thread_mem_ctx->last_consumer_tracker_label(), | 78 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str()); | 79 | |
| 80 | 0 | if (doris::config::stacktrace_in_alloc_large_memory_bytes > 0 && | 81 | 0 | size > doris::config::stacktrace_in_alloc_large_memory_bytes) { | 82 | 0 | *err_msg += "\nAlloc Stacktrace:\n" + doris::get_stack_trace(); | 83 | 0 | } | 84 | 0 | return true; | 85 | 0 | } | 86 | 4 | return false; | 87 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 52 | 687k | std::string* err_msg) const { | 53 | 687k | #ifdef BE_TEST | 54 | 687k | if (!doris::pthread_context_ptr_init) { | 55 | 100 | return false; | 56 | 100 | } | 57 | 687k | #endif | 58 | 687k | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 59 | 0 | return false; | 60 | 0 | } | 61 | | | 62 | 687k | if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 63 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 64 | | // Only thread attach task, and has not completely waited for thread_wait_gc_max_milliseconds, | 65 | | // will wait for gc. otherwise, if the outside will catch the exception, throwing an exception. | 66 | 0 | *err_msg += fmt::format( | 67 | 0 | "Allocator sys memory check failed: Cannot alloc:{}, consuming " | 68 | 0 | "tracker:<{}>, peak used {}, current used {}, reserved {}, exec node:<{}>, {}.", | 69 | 0 | doris::PrettyPrinter::print_bytes(size), | 70 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 71 | 0 | doris::PrettyPrinter::print_bytes( | 72 | 0 | thread_mem_ctx->limiter_mem_tracker()->peak_consumption()), | 73 | 0 | doris::PrettyPrinter::print_bytes( | 74 | 0 | thread_mem_ctx->limiter_mem_tracker()->consumption()), | 75 | 0 | doris::PrettyPrinter::print_bytes( | 76 | 0 | thread_mem_ctx->limiter_mem_tracker()->reserved_consumption()), | 77 | 0 | thread_mem_ctx->last_consumer_tracker_label(), | 78 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str()); | 79 | |
| 80 | 0 | if (doris::config::stacktrace_in_alloc_large_memory_bytes > 0 && | 81 | 0 | size > doris::config::stacktrace_in_alloc_large_memory_bytes) { | 82 | 0 | *err_msg += "\nAlloc Stacktrace:\n" + doris::get_stack_trace(); | 83 | 0 | } | 84 | 0 | return true; | 85 | 0 | } | 86 | 687k | return false; | 87 | 687k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 52 | 2.14M | std::string* err_msg) const { | 53 | 2.14M | #ifdef BE_TEST | 54 | 2.14M | if (!doris::pthread_context_ptr_init) { | 55 | 19.9k | return false; | 56 | 19.9k | } | 57 | 2.12M | #endif | 58 | 2.12M | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 59 | 0 | return false; | 60 | 0 | } | 61 | | | 62 | 2.12M | if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 63 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 64 | | // Only thread attach task, and has not completely waited for thread_wait_gc_max_milliseconds, | 65 | | // will wait for gc. otherwise, if the outside will catch the exception, throwing an exception. | 66 | 0 | *err_msg += fmt::format( | 67 | 0 | "Allocator sys memory check failed: Cannot alloc:{}, consuming " | 68 | 0 | "tracker:<{}>, peak used {}, current used {}, reserved {}, exec node:<{}>, {}.", | 69 | 0 | doris::PrettyPrinter::print_bytes(size), | 70 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 71 | 0 | doris::PrettyPrinter::print_bytes( | 72 | 0 | thread_mem_ctx->limiter_mem_tracker()->peak_consumption()), | 73 | 0 | doris::PrettyPrinter::print_bytes( | 74 | 0 | thread_mem_ctx->limiter_mem_tracker()->consumption()), | 75 | 0 | doris::PrettyPrinter::print_bytes( | 76 | 0 | thread_mem_ctx->limiter_mem_tracker()->reserved_consumption()), | 77 | 0 | thread_mem_ctx->last_consumer_tracker_label(), | 78 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str()); | 79 | |
| 80 | 0 | if (doris::config::stacktrace_in_alloc_large_memory_bytes > 0 && | 81 | 0 | size > doris::config::stacktrace_in_alloc_large_memory_bytes) { | 82 | 0 | *err_msg += "\nAlloc Stacktrace:\n" + doris::get_stack_trace(); | 83 | 0 | } | 84 | 0 | return true; | 85 | 0 | } | 86 | 2.12M | return false; | 87 | 2.12M | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 52 | 3.48k | std::string* err_msg) const { | 53 | 3.48k | #ifdef BE_TEST | 54 | 3.48k | if (!doris::pthread_context_ptr_init) { | 55 | 0 | return false; | 56 | 0 | } | 57 | 3.48k | #endif | 58 | 3.48k | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 59 | 0 | return false; | 60 | 0 | } | 61 | | | 62 | 3.48k | if (doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 63 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 64 | | // Only thread attach task, and has not completely waited for thread_wait_gc_max_milliseconds, | 65 | | // will wait for gc. otherwise, if the outside will catch the exception, throwing an exception. | 66 | 0 | *err_msg += fmt::format( | 67 | 0 | "Allocator sys memory check failed: Cannot alloc:{}, consuming " | 68 | 0 | "tracker:<{}>, peak used {}, current used {}, reserved {}, exec node:<{}>, {}.", | 69 | 0 | doris::PrettyPrinter::print_bytes(size), | 70 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 71 | 0 | doris::PrettyPrinter::print_bytes( | 72 | 0 | thread_mem_ctx->limiter_mem_tracker()->peak_consumption()), | 73 | 0 | doris::PrettyPrinter::print_bytes( | 74 | 0 | thread_mem_ctx->limiter_mem_tracker()->consumption()), | 75 | 0 | doris::PrettyPrinter::print_bytes( | 76 | 0 | thread_mem_ctx->limiter_mem_tracker()->reserved_consumption()), | 77 | 0 | thread_mem_ctx->last_consumer_tracker_label(), | 78 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str()); | 79 | |
| 80 | 0 | if (doris::config::stacktrace_in_alloc_large_memory_bytes > 0 && | 81 | 0 | size > doris::config::stacktrace_in_alloc_large_memory_bytes) { | 82 | 0 | *err_msg += "\nAlloc Stacktrace:\n" + doris::get_stack_trace(); | 83 | 0 | } | 84 | 0 | return true; | 85 | 0 | } | 86 | 3.48k | return false; | 87 | 3.48k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE |
88 | | |
89 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
90 | | bool check_and_tracking_memory> |
91 | | void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
92 | 714k | check_and_tracking_memory>::alloc_fault_probability() const { |
93 | 714k | #ifdef BE_TEST |
94 | 714k | if (!doris::pthread_context_ptr_init) { |
95 | 400 | return; |
96 | 400 | } |
97 | 714k | #endif |
98 | 714k | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { |
99 | 0 | return; |
100 | 0 | } |
101 | | |
102 | 714k | if (UNLIKELY(doris::config::mem_alloc_fault_probability > 0.0)) { |
103 | 0 | std::random_device rd; |
104 | 0 | std::mt19937 gen(rd()); |
105 | 0 | std::bernoulli_distribution fault(doris::config::mem_alloc_fault_probability); |
106 | 0 | if (fault(gen)) { |
107 | 0 | const std::string injection_err_msg = fmt::format( |
108 | 0 | "[MemAllocInjectFault] Task {} alloc memory failed due to fault " |
109 | 0 | "injection.", |
110 | 0 | doris::thread_context() |
111 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() |
112 | 0 | ->label()); |
113 | | // Print stack trace for debug. |
114 | 0 | [[maybe_unused]] auto stack_trace_st = |
115 | 0 | doris::Status::Error<doris::ErrorCode::MEM_ALLOC_FAILED, true>( |
116 | 0 | injection_err_msg); |
117 | 0 | if (!doris::config::enable_stacktrace) { |
118 | 0 | LOG(INFO) << stack_trace_st.to_string(); |
119 | 0 | } |
120 | 0 | if (doris::enable_thread_catch_bad_alloc) { |
121 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, injection_err_msg); |
122 | 0 | } |
123 | 0 | } |
124 | 0 | } |
125 | 714k | } _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv Line | Count | Source | 92 | 4 | check_and_tracking_memory>::alloc_fault_probability() const { | 93 | 4 | #ifdef BE_TEST | 94 | 4 | if (!doris::pthread_context_ptr_init) { | 95 | 0 | return; | 96 | 0 | } | 97 | 4 | #endif | 98 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 99 | 0 | return; | 100 | 0 | } | 101 | | | 102 | 4 | if (UNLIKELY(doris::config::mem_alloc_fault_probability > 0.0)) { | 103 | 0 | std::random_device rd; | 104 | 0 | std::mt19937 gen(rd()); | 105 | 0 | std::bernoulli_distribution fault(doris::config::mem_alloc_fault_probability); | 106 | 0 | if (fault(gen)) { | 107 | 0 | const std::string injection_err_msg = fmt::format( | 108 | 0 | "[MemAllocInjectFault] Task {} alloc memory failed due to fault " | 109 | 0 | "injection.", | 110 | 0 | doris::thread_context() | 111 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 112 | 0 | ->label()); | 113 | | // Print stack trace for debug. | 114 | 0 | [[maybe_unused]] auto stack_trace_st = | 115 | 0 | doris::Status::Error<doris::ErrorCode::MEM_ALLOC_FAILED, true>( | 116 | 0 | injection_err_msg); | 117 | 0 | if (!doris::config::enable_stacktrace) { | 118 | 0 | LOG(INFO) << stack_trace_st.to_string(); | 119 | 0 | } | 120 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 121 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, injection_err_msg); | 122 | 0 | } | 123 | 0 | } | 124 | 0 | } | 125 | 4 | } |
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv Line | Count | Source | 92 | 844 | check_and_tracking_memory>::alloc_fault_probability() const { | 93 | 844 | #ifdef BE_TEST | 94 | 844 | if (!doris::pthread_context_ptr_init) { | 95 | 0 | return; | 96 | 0 | } | 97 | 844 | #endif | 98 | 844 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 99 | 0 | return; | 100 | 0 | } | 101 | | | 102 | 844 | if (UNLIKELY(doris::config::mem_alloc_fault_probability > 0.0)) { | 103 | 0 | std::random_device rd; | 104 | 0 | std::mt19937 gen(rd()); | 105 | 0 | std::bernoulli_distribution fault(doris::config::mem_alloc_fault_probability); | 106 | 0 | if (fault(gen)) { | 107 | 0 | const std::string injection_err_msg = fmt::format( | 108 | 0 | "[MemAllocInjectFault] Task {} alloc memory failed due to fault " | 109 | 0 | "injection.", | 110 | 0 | doris::thread_context() | 111 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 112 | 0 | ->label()); | 113 | | // Print stack trace for debug. | 114 | 0 | [[maybe_unused]] auto stack_trace_st = | 115 | 0 | doris::Status::Error<doris::ErrorCode::MEM_ALLOC_FAILED, true>( | 116 | 0 | injection_err_msg); | 117 | 0 | if (!doris::config::enable_stacktrace) { | 118 | 0 | LOG(INFO) << stack_trace_st.to_string(); | 119 | 0 | } | 120 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 121 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, injection_err_msg); | 122 | 0 | } | 123 | 0 | } | 124 | 0 | } | 125 | 844 | } |
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv Line | Count | Source | 92 | 4 | check_and_tracking_memory>::alloc_fault_probability() const { | 93 | 4 | #ifdef BE_TEST | 94 | 4 | if (!doris::pthread_context_ptr_init) { | 95 | 0 | return; | 96 | 0 | } | 97 | 4 | #endif | 98 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 99 | 0 | return; | 100 | 0 | } | 101 | | | 102 | 4 | if (UNLIKELY(doris::config::mem_alloc_fault_probability > 0.0)) { | 103 | 0 | std::random_device rd; | 104 | 0 | std::mt19937 gen(rd()); | 105 | 0 | std::bernoulli_distribution fault(doris::config::mem_alloc_fault_probability); | 106 | 0 | if (fault(gen)) { | 107 | 0 | const std::string injection_err_msg = fmt::format( | 108 | 0 | "[MemAllocInjectFault] Task {} alloc memory failed due to fault " | 109 | 0 | "injection.", | 110 | 0 | doris::thread_context() | 111 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 112 | 0 | ->label()); | 113 | | // Print stack trace for debug. | 114 | 0 | [[maybe_unused]] auto stack_trace_st = | 115 | 0 | doris::Status::Error<doris::ErrorCode::MEM_ALLOC_FAILED, true>( | 116 | 0 | injection_err_msg); | 117 | 0 | if (!doris::config::enable_stacktrace) { | 118 | 0 | LOG(INFO) << stack_trace_st.to_string(); | 119 | 0 | } | 120 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 121 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, injection_err_msg); | 122 | 0 | } | 123 | 0 | } | 124 | 0 | } | 125 | 4 | } |
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv Line | Count | Source | 92 | 22.2k | check_and_tracking_memory>::alloc_fault_probability() const { | 93 | 22.2k | #ifdef BE_TEST | 94 | 22.2k | if (!doris::pthread_context_ptr_init) { | 95 | 300 | return; | 96 | 300 | } | 97 | 21.9k | #endif | 98 | 21.9k | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 99 | 0 | return; | 100 | 0 | } | 101 | | | 102 | 21.9k | if (UNLIKELY(doris::config::mem_alloc_fault_probability > 0.0)) { | 103 | 0 | std::random_device rd; | 104 | 0 | std::mt19937 gen(rd()); | 105 | 0 | std::bernoulli_distribution fault(doris::config::mem_alloc_fault_probability); | 106 | 0 | if (fault(gen)) { | 107 | 0 | const std::string injection_err_msg = fmt::format( | 108 | 0 | "[MemAllocInjectFault] Task {} alloc memory failed due to fault " | 109 | 0 | "injection.", | 110 | 0 | doris::thread_context() | 111 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 112 | 0 | ->label()); | 113 | | // Print stack trace for debug. | 114 | 0 | [[maybe_unused]] auto stack_trace_st = | 115 | 0 | doris::Status::Error<doris::ErrorCode::MEM_ALLOC_FAILED, true>( | 116 | 0 | injection_err_msg); | 117 | 0 | if (!doris::config::enable_stacktrace) { | 118 | 0 | LOG(INFO) << stack_trace_st.to_string(); | 119 | 0 | } | 120 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 121 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, injection_err_msg); | 122 | 0 | } | 123 | 0 | } | 124 | 0 | } | 125 | 21.9k | } |
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv Line | Count | Source | 92 | 4 | check_and_tracking_memory>::alloc_fault_probability() const { | 93 | 4 | #ifdef BE_TEST | 94 | 4 | if (!doris::pthread_context_ptr_init) { | 95 | 0 | return; | 96 | 0 | } | 97 | 4 | #endif | 98 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 99 | 0 | return; | 100 | 0 | } | 101 | | | 102 | 4 | if (UNLIKELY(doris::config::mem_alloc_fault_probability > 0.0)) { | 103 | 0 | std::random_device rd; | 104 | 0 | std::mt19937 gen(rd()); | 105 | 0 | std::bernoulli_distribution fault(doris::config::mem_alloc_fault_probability); | 106 | 0 | if (fault(gen)) { | 107 | 0 | const std::string injection_err_msg = fmt::format( | 108 | 0 | "[MemAllocInjectFault] Task {} alloc memory failed due to fault " | 109 | 0 | "injection.", | 110 | 0 | doris::thread_context() | 111 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 112 | 0 | ->label()); | 113 | | // Print stack trace for debug. | 114 | 0 | [[maybe_unused]] auto stack_trace_st = | 115 | 0 | doris::Status::Error<doris::ErrorCode::MEM_ALLOC_FAILED, true>( | 116 | 0 | injection_err_msg); | 117 | 0 | if (!doris::config::enable_stacktrace) { | 118 | 0 | LOG(INFO) << stack_trace_st.to_string(); | 119 | 0 | } | 120 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 121 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, injection_err_msg); | 122 | 0 | } | 123 | 0 | } | 124 | 0 | } | 125 | 4 | } |
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv Line | Count | Source | 92 | 4 | check_and_tracking_memory>::alloc_fault_probability() const { | 93 | 4 | #ifdef BE_TEST | 94 | 4 | if (!doris::pthread_context_ptr_init) { | 95 | 0 | return; | 96 | 0 | } | 97 | 4 | #endif | 98 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 99 | 0 | return; | 100 | 0 | } | 101 | | | 102 | 4 | if (UNLIKELY(doris::config::mem_alloc_fault_probability > 0.0)) { | 103 | 0 | std::random_device rd; | 104 | 0 | std::mt19937 gen(rd()); | 105 | 0 | std::bernoulli_distribution fault(doris::config::mem_alloc_fault_probability); | 106 | 0 | if (fault(gen)) { | 107 | 0 | const std::string injection_err_msg = fmt::format( | 108 | 0 | "[MemAllocInjectFault] Task {} alloc memory failed due to fault " | 109 | 0 | "injection.", | 110 | 0 | doris::thread_context() | 111 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 112 | 0 | ->label()); | 113 | | // Print stack trace for debug. | 114 | 0 | [[maybe_unused]] auto stack_trace_st = | 115 | 0 | doris::Status::Error<doris::ErrorCode::MEM_ALLOC_FAILED, true>( | 116 | 0 | injection_err_msg); | 117 | 0 | if (!doris::config::enable_stacktrace) { | 118 | 0 | LOG(INFO) << stack_trace_st.to_string(); | 119 | 0 | } | 120 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 121 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, injection_err_msg); | 122 | 0 | } | 123 | 0 | } | 124 | 0 | } | 125 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv Line | Count | Source | 92 | 4 | check_and_tracking_memory>::alloc_fault_probability() const { | 93 | 4 | #ifdef BE_TEST | 94 | 4 | if (!doris::pthread_context_ptr_init) { | 95 | 0 | return; | 96 | 0 | } | 97 | 4 | #endif | 98 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 99 | 0 | return; | 100 | 0 | } | 101 | | | 102 | 4 | if (UNLIKELY(doris::config::mem_alloc_fault_probability > 0.0)) { | 103 | 0 | std::random_device rd; | 104 | 0 | std::mt19937 gen(rd()); | 105 | 0 | std::bernoulli_distribution fault(doris::config::mem_alloc_fault_probability); | 106 | 0 | if (fault(gen)) { | 107 | 0 | const std::string injection_err_msg = fmt::format( | 108 | 0 | "[MemAllocInjectFault] Task {} alloc memory failed due to fault " | 109 | 0 | "injection.", | 110 | 0 | doris::thread_context() | 111 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 112 | 0 | ->label()); | 113 | | // Print stack trace for debug. | 114 | 0 | [[maybe_unused]] auto stack_trace_st = | 115 | 0 | doris::Status::Error<doris::ErrorCode::MEM_ALLOC_FAILED, true>( | 116 | 0 | injection_err_msg); | 117 | 0 | if (!doris::config::enable_stacktrace) { | 118 | 0 | LOG(INFO) << stack_trace_st.to_string(); | 119 | 0 | } | 120 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 121 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, injection_err_msg); | 122 | 0 | } | 123 | 0 | } | 124 | 0 | } | 125 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv Line | Count | Source | 92 | 687k | check_and_tracking_memory>::alloc_fault_probability() const { | 93 | 687k | #ifdef BE_TEST | 94 | 687k | if (!doris::pthread_context_ptr_init) { | 95 | 100 | return; | 96 | 100 | } | 97 | 687k | #endif | 98 | 687k | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 99 | 0 | return; | 100 | 0 | } | 101 | | | 102 | 687k | if (UNLIKELY(doris::config::mem_alloc_fault_probability > 0.0)) { | 103 | 0 | std::random_device rd; | 104 | 0 | std::mt19937 gen(rd()); | 105 | 0 | std::bernoulli_distribution fault(doris::config::mem_alloc_fault_probability); | 106 | 0 | if (fault(gen)) { | 107 | 0 | const std::string injection_err_msg = fmt::format( | 108 | 0 | "[MemAllocInjectFault] Task {} alloc memory failed due to fault " | 109 | 0 | "injection.", | 110 | 0 | doris::thread_context() | 111 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 112 | 0 | ->label()); | 113 | | // Print stack trace for debug. | 114 | 0 | [[maybe_unused]] auto stack_trace_st = | 115 | 0 | doris::Status::Error<doris::ErrorCode::MEM_ALLOC_FAILED, true>( | 116 | 0 | injection_err_msg); | 117 | 0 | if (!doris::config::enable_stacktrace) { | 118 | 0 | LOG(INFO) << stack_trace_st.to_string(); | 119 | 0 | } | 120 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 121 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, injection_err_msg); | 122 | 0 | } | 123 | 0 | } | 124 | 0 | } | 125 | 687k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE23alloc_fault_probabilityEv _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE23alloc_fault_probabilityEv Line | Count | Source | 92 | 3.48k | check_and_tracking_memory>::alloc_fault_probability() const { | 93 | 3.48k | #ifdef BE_TEST | 94 | 3.48k | if (!doris::pthread_context_ptr_init) { | 95 | 0 | return; | 96 | 0 | } | 97 | 3.48k | #endif | 98 | 3.48k | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 99 | 0 | return; | 100 | 0 | } | 101 | | | 102 | 3.48k | if (UNLIKELY(doris::config::mem_alloc_fault_probability > 0.0)) { | 103 | 0 | std::random_device rd; | 104 | 0 | std::mt19937 gen(rd()); | 105 | 0 | std::bernoulli_distribution fault(doris::config::mem_alloc_fault_probability); | 106 | 0 | if (fault(gen)) { | 107 | 0 | const std::string injection_err_msg = fmt::format( | 108 | 0 | "[MemAllocInjectFault] Task {} alloc memory failed due to fault " | 109 | 0 | "injection.", | 110 | 0 | doris::thread_context() | 111 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 112 | 0 | ->label()); | 113 | | // Print stack trace for debug. | 114 | 0 | [[maybe_unused]] auto stack_trace_st = | 115 | 0 | doris::Status::Error<doris::ErrorCode::MEM_ALLOC_FAILED, true>( | 116 | 0 | injection_err_msg); | 117 | 0 | if (!doris::config::enable_stacktrace) { | 118 | 0 | LOG(INFO) << stack_trace_st.to_string(); | 119 | 0 | } | 120 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 121 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, injection_err_msg); | 122 | 0 | } | 123 | 0 | } | 124 | 0 | } | 125 | 3.48k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE23alloc_fault_probabilityEv Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE23alloc_fault_probabilityEv |
126 | | |
127 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
128 | | bool check_and_tracking_memory> |
129 | | void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
130 | 714k | check_and_tracking_memory>::sys_memory_check(size_t size) const { |
131 | 714k | std::string err_msg; |
132 | 714k | if (sys_memory_exceed(size, &err_msg)) { |
133 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); |
134 | 0 | if (thread_mem_ctx->wait_gc()) { |
135 | 0 | int64_t wait_milliseconds = 0; |
136 | 0 | LOG(INFO) << fmt::format( |
137 | 0 | "Task:{} waiting for enough memory in thread id:{}, maximum {}ms, {}.", |
138 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), |
139 | 0 | doris::ThreadContext::get_thread_id(), |
140 | 0 | doris::config::thread_wait_gc_max_milliseconds, err_msg); |
141 | | |
142 | | // only task thread exceeded memory limit for the first time and wait_gc is true. |
143 | | // TODO, in the future, try to free memory and waiting for memory to be freed in pipeline scheduling. |
144 | 0 | doris::JemallocControl::je_thread_tcache_flush(); |
145 | 0 | doris::MemoryReclamation::je_purge_dirty_pages(); |
146 | |
|
147 | 0 | if (!doris::config::disable_memory_gc) { |
148 | | // Allocator is not aware of whether the query is canceled. |
149 | | // even if the query is canceled, it will not end early. |
150 | | // this may cause query to be cancelled more slowly, but it is not a major problem. |
151 | 0 | while (wait_milliseconds < doris::config::thread_wait_gc_max_milliseconds) { |
152 | 0 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); |
153 | 0 | if (!doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { |
154 | 0 | doris::GlobalMemoryArbitrator::refresh_interval_memory_growth += size; |
155 | 0 | break; |
156 | 0 | } |
157 | 0 | wait_milliseconds += 100; |
158 | 0 | } |
159 | 0 | } else { |
160 | 0 | wait_milliseconds = doris::config::thread_wait_gc_max_milliseconds; |
161 | 0 | } |
162 | | |
163 | | // If true, it means that after waiting for a while, there is still not enough memory, |
164 | | // and try to throw an exception. |
165 | | // else, enough memory is available, the task continues execute. |
166 | 0 | if (wait_milliseconds >= doris::config::thread_wait_gc_max_milliseconds) { |
167 | | // Make sure to completely wait thread_wait_gc_max_milliseconds only once. |
168 | 0 | thread_mem_ctx->disable_wait_gc(); |
169 | 0 | doris::ProcessProfile::instance()->memory_profile()->print_log_process_usage(); |
170 | | |
171 | | // If the outside will catch the exception, after throwing an exception, |
172 | | // the task will actively cancel itself. |
173 | 0 | if (doris::enable_thread_catch_bad_alloc) { |
174 | 0 | LOG(INFO) << fmt::format( |
175 | 0 | "Task:{} sys memory check failed, throw exception, after waiting for " |
176 | 0 | "memory {}ms, {}.", |
177 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, |
178 | 0 | err_msg); |
179 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); |
180 | 0 | } else { |
181 | 0 | LOG(INFO) << fmt::format( |
182 | 0 | "Task:{} sys memory check failed, will continue to execute, cannot " |
183 | 0 | "throw exception, after waiting for memory {}ms, {}.", |
184 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, |
185 | 0 | err_msg); |
186 | 0 | } |
187 | 0 | } |
188 | 0 | } else if (doris::enable_thread_catch_bad_alloc) { |
189 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); |
190 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); |
191 | 0 | } else { |
192 | 0 | LOG(INFO) << fmt::format("{}, no throw exception.", err_msg); |
193 | 0 | } |
194 | 0 | } |
195 | 714k | } _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm Line | Count | Source | 130 | 4 | check_and_tracking_memory>::sys_memory_check(size_t size) const { | 131 | 4 | std::string err_msg; | 132 | 4 | if (sys_memory_exceed(size, &err_msg)) { | 133 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 134 | 0 | if (thread_mem_ctx->wait_gc()) { | 135 | 0 | int64_t wait_milliseconds = 0; | 136 | 0 | LOG(INFO) << fmt::format( | 137 | 0 | "Task:{} waiting for enough memory in thread id:{}, maximum {}ms, {}.", | 138 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 139 | 0 | doris::ThreadContext::get_thread_id(), | 140 | 0 | doris::config::thread_wait_gc_max_milliseconds, err_msg); | 141 | | | 142 | | // only task thread exceeded memory limit for the first time and wait_gc is true. | 143 | | // TODO, in the future, try to free memory and waiting for memory to be freed in pipeline scheduling. | 144 | 0 | doris::JemallocControl::je_thread_tcache_flush(); | 145 | 0 | doris::MemoryReclamation::je_purge_dirty_pages(); | 146 | |
| 147 | 0 | if (!doris::config::disable_memory_gc) { | 148 | | // Allocator is not aware of whether the query is canceled. | 149 | | // even if the query is canceled, it will not end early. | 150 | | // this may cause query to be cancelled more slowly, but it is not a major problem. | 151 | 0 | while (wait_milliseconds < doris::config::thread_wait_gc_max_milliseconds) { | 152 | 0 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); | 153 | 0 | if (!doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 154 | 0 | doris::GlobalMemoryArbitrator::refresh_interval_memory_growth += size; | 155 | 0 | break; | 156 | 0 | } | 157 | 0 | wait_milliseconds += 100; | 158 | 0 | } | 159 | 0 | } else { | 160 | 0 | wait_milliseconds = doris::config::thread_wait_gc_max_milliseconds; | 161 | 0 | } | 162 | | | 163 | | // If true, it means that after waiting for a while, there is still not enough memory, | 164 | | // and try to throw an exception. | 165 | | // else, enough memory is available, the task continues execute. | 166 | 0 | if (wait_milliseconds >= doris::config::thread_wait_gc_max_milliseconds) { | 167 | | // Make sure to completely wait thread_wait_gc_max_milliseconds only once. | 168 | 0 | thread_mem_ctx->disable_wait_gc(); | 169 | 0 | doris::ProcessProfile::instance()->memory_profile()->print_log_process_usage(); | 170 | | | 171 | | // If the outside will catch the exception, after throwing an exception, | 172 | | // the task will actively cancel itself. | 173 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 174 | 0 | LOG(INFO) << fmt::format( | 175 | 0 | "Task:{} sys memory check failed, throw exception, after waiting for " | 176 | 0 | "memory {}ms, {}.", | 177 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 178 | 0 | err_msg); | 179 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 180 | 0 | } else { | 181 | 0 | LOG(INFO) << fmt::format( | 182 | 0 | "Task:{} sys memory check failed, will continue to execute, cannot " | 183 | 0 | "throw exception, after waiting for memory {}ms, {}.", | 184 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 185 | 0 | err_msg); | 186 | 0 | } | 187 | 0 | } | 188 | 0 | } else if (doris::enable_thread_catch_bad_alloc) { | 189 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 190 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 191 | 0 | } else { | 192 | | LOG(INFO) << fmt::format("{}, no throw exception.", err_msg); | 193 | 0 | } | 194 | 0 | } | 195 | 4 | } |
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm Line | Count | Source | 130 | 844 | check_and_tracking_memory>::sys_memory_check(size_t size) const { | 131 | 844 | std::string err_msg; | 132 | 844 | if (sys_memory_exceed(size, &err_msg)) { | 133 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 134 | 0 | if (thread_mem_ctx->wait_gc()) { | 135 | 0 | int64_t wait_milliseconds = 0; | 136 | 0 | LOG(INFO) << fmt::format( | 137 | 0 | "Task:{} waiting for enough memory in thread id:{}, maximum {}ms, {}.", | 138 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 139 | 0 | doris::ThreadContext::get_thread_id(), | 140 | 0 | doris::config::thread_wait_gc_max_milliseconds, err_msg); | 141 | | | 142 | | // only task thread exceeded memory limit for the first time and wait_gc is true. | 143 | | // TODO, in the future, try to free memory and waiting for memory to be freed in pipeline scheduling. | 144 | 0 | doris::JemallocControl::je_thread_tcache_flush(); | 145 | 0 | doris::MemoryReclamation::je_purge_dirty_pages(); | 146 | |
| 147 | 0 | if (!doris::config::disable_memory_gc) { | 148 | | // Allocator is not aware of whether the query is canceled. | 149 | | // even if the query is canceled, it will not end early. | 150 | | // this may cause query to be cancelled more slowly, but it is not a major problem. | 151 | 0 | while (wait_milliseconds < doris::config::thread_wait_gc_max_milliseconds) { | 152 | 0 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); | 153 | 0 | if (!doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 154 | 0 | doris::GlobalMemoryArbitrator::refresh_interval_memory_growth += size; | 155 | 0 | break; | 156 | 0 | } | 157 | 0 | wait_milliseconds += 100; | 158 | 0 | } | 159 | 0 | } else { | 160 | 0 | wait_milliseconds = doris::config::thread_wait_gc_max_milliseconds; | 161 | 0 | } | 162 | | | 163 | | // If true, it means that after waiting for a while, there is still not enough memory, | 164 | | // and try to throw an exception. | 165 | | // else, enough memory is available, the task continues execute. | 166 | 0 | if (wait_milliseconds >= doris::config::thread_wait_gc_max_milliseconds) { | 167 | | // Make sure to completely wait thread_wait_gc_max_milliseconds only once. | 168 | 0 | thread_mem_ctx->disable_wait_gc(); | 169 | 0 | doris::ProcessProfile::instance()->memory_profile()->print_log_process_usage(); | 170 | | | 171 | | // If the outside will catch the exception, after throwing an exception, | 172 | | // the task will actively cancel itself. | 173 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 174 | 0 | LOG(INFO) << fmt::format( | 175 | 0 | "Task:{} sys memory check failed, throw exception, after waiting for " | 176 | 0 | "memory {}ms, {}.", | 177 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 178 | 0 | err_msg); | 179 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 180 | 0 | } else { | 181 | 0 | LOG(INFO) << fmt::format( | 182 | 0 | "Task:{} sys memory check failed, will continue to execute, cannot " | 183 | 0 | "throw exception, after waiting for memory {}ms, {}.", | 184 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 185 | 0 | err_msg); | 186 | 0 | } | 187 | 0 | } | 188 | 0 | } else if (doris::enable_thread_catch_bad_alloc) { | 189 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 190 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 191 | 0 | } else { | 192 | | LOG(INFO) << fmt::format("{}, no throw exception.", err_msg); | 193 | 0 | } | 194 | 0 | } | 195 | 844 | } |
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm Line | Count | Source | 130 | 4 | check_and_tracking_memory>::sys_memory_check(size_t size) const { | 131 | 4 | std::string err_msg; | 132 | 4 | if (sys_memory_exceed(size, &err_msg)) { | 133 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 134 | 0 | if (thread_mem_ctx->wait_gc()) { | 135 | 0 | int64_t wait_milliseconds = 0; | 136 | 0 | LOG(INFO) << fmt::format( | 137 | 0 | "Task:{} waiting for enough memory in thread id:{}, maximum {}ms, {}.", | 138 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 139 | 0 | doris::ThreadContext::get_thread_id(), | 140 | 0 | doris::config::thread_wait_gc_max_milliseconds, err_msg); | 141 | | | 142 | | // only task thread exceeded memory limit for the first time and wait_gc is true. | 143 | | // TODO, in the future, try to free memory and waiting for memory to be freed in pipeline scheduling. | 144 | 0 | doris::JemallocControl::je_thread_tcache_flush(); | 145 | 0 | doris::MemoryReclamation::je_purge_dirty_pages(); | 146 | |
| 147 | 0 | if (!doris::config::disable_memory_gc) { | 148 | | // Allocator is not aware of whether the query is canceled. | 149 | | // even if the query is canceled, it will not end early. | 150 | | // this may cause query to be cancelled more slowly, but it is not a major problem. | 151 | 0 | while (wait_milliseconds < doris::config::thread_wait_gc_max_milliseconds) { | 152 | 0 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); | 153 | 0 | if (!doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 154 | 0 | doris::GlobalMemoryArbitrator::refresh_interval_memory_growth += size; | 155 | 0 | break; | 156 | 0 | } | 157 | 0 | wait_milliseconds += 100; | 158 | 0 | } | 159 | 0 | } else { | 160 | 0 | wait_milliseconds = doris::config::thread_wait_gc_max_milliseconds; | 161 | 0 | } | 162 | | | 163 | | // If true, it means that after waiting for a while, there is still not enough memory, | 164 | | // and try to throw an exception. | 165 | | // else, enough memory is available, the task continues execute. | 166 | 0 | if (wait_milliseconds >= doris::config::thread_wait_gc_max_milliseconds) { | 167 | | // Make sure to completely wait thread_wait_gc_max_milliseconds only once. | 168 | 0 | thread_mem_ctx->disable_wait_gc(); | 169 | 0 | doris::ProcessProfile::instance()->memory_profile()->print_log_process_usage(); | 170 | | | 171 | | // If the outside will catch the exception, after throwing an exception, | 172 | | // the task will actively cancel itself. | 173 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 174 | 0 | LOG(INFO) << fmt::format( | 175 | 0 | "Task:{} sys memory check failed, throw exception, after waiting for " | 176 | 0 | "memory {}ms, {}.", | 177 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 178 | 0 | err_msg); | 179 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 180 | 0 | } else { | 181 | 0 | LOG(INFO) << fmt::format( | 182 | 0 | "Task:{} sys memory check failed, will continue to execute, cannot " | 183 | 0 | "throw exception, after waiting for memory {}ms, {}.", | 184 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 185 | 0 | err_msg); | 186 | 0 | } | 187 | 0 | } | 188 | 0 | } else if (doris::enable_thread_catch_bad_alloc) { | 189 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 190 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 191 | 0 | } else { | 192 | | LOG(INFO) << fmt::format("{}, no throw exception.", err_msg); | 193 | 0 | } | 194 | 0 | } | 195 | 4 | } |
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm Line | Count | Source | 130 | 22.2k | check_and_tracking_memory>::sys_memory_check(size_t size) const { | 131 | 22.2k | std::string err_msg; | 132 | 22.2k | if (sys_memory_exceed(size, &err_msg)) { | 133 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 134 | 0 | if (thread_mem_ctx->wait_gc()) { | 135 | 0 | int64_t wait_milliseconds = 0; | 136 | 0 | LOG(INFO) << fmt::format( | 137 | 0 | "Task:{} waiting for enough memory in thread id:{}, maximum {}ms, {}.", | 138 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 139 | 0 | doris::ThreadContext::get_thread_id(), | 140 | 0 | doris::config::thread_wait_gc_max_milliseconds, err_msg); | 141 | | | 142 | | // only task thread exceeded memory limit for the first time and wait_gc is true. | 143 | | // TODO, in the future, try to free memory and waiting for memory to be freed in pipeline scheduling. | 144 | 0 | doris::JemallocControl::je_thread_tcache_flush(); | 145 | 0 | doris::MemoryReclamation::je_purge_dirty_pages(); | 146 | |
| 147 | 0 | if (!doris::config::disable_memory_gc) { | 148 | | // Allocator is not aware of whether the query is canceled. | 149 | | // even if the query is canceled, it will not end early. | 150 | | // this may cause query to be cancelled more slowly, but it is not a major problem. | 151 | 0 | while (wait_milliseconds < doris::config::thread_wait_gc_max_milliseconds) { | 152 | 0 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); | 153 | 0 | if (!doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 154 | 0 | doris::GlobalMemoryArbitrator::refresh_interval_memory_growth += size; | 155 | 0 | break; | 156 | 0 | } | 157 | 0 | wait_milliseconds += 100; | 158 | 0 | } | 159 | 0 | } else { | 160 | 0 | wait_milliseconds = doris::config::thread_wait_gc_max_milliseconds; | 161 | 0 | } | 162 | | | 163 | | // If true, it means that after waiting for a while, there is still not enough memory, | 164 | | // and try to throw an exception. | 165 | | // else, enough memory is available, the task continues execute. | 166 | 0 | if (wait_milliseconds >= doris::config::thread_wait_gc_max_milliseconds) { | 167 | | // Make sure to completely wait thread_wait_gc_max_milliseconds only once. | 168 | 0 | thread_mem_ctx->disable_wait_gc(); | 169 | 0 | doris::ProcessProfile::instance()->memory_profile()->print_log_process_usage(); | 170 | | | 171 | | // If the outside will catch the exception, after throwing an exception, | 172 | | // the task will actively cancel itself. | 173 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 174 | 0 | LOG(INFO) << fmt::format( | 175 | 0 | "Task:{} sys memory check failed, throw exception, after waiting for " | 176 | 0 | "memory {}ms, {}.", | 177 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 178 | 0 | err_msg); | 179 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 180 | 0 | } else { | 181 | 0 | LOG(INFO) << fmt::format( | 182 | 0 | "Task:{} sys memory check failed, will continue to execute, cannot " | 183 | 0 | "throw exception, after waiting for memory {}ms, {}.", | 184 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 185 | 0 | err_msg); | 186 | 0 | } | 187 | 0 | } | 188 | 0 | } else if (doris::enable_thread_catch_bad_alloc) { | 189 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 190 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 191 | 0 | } else { | 192 | | LOG(INFO) << fmt::format("{}, no throw exception.", err_msg); | 193 | 0 | } | 194 | 0 | } | 195 | 22.2k | } |
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm Line | Count | Source | 130 | 4 | check_and_tracking_memory>::sys_memory_check(size_t size) const { | 131 | 4 | std::string err_msg; | 132 | 4 | if (sys_memory_exceed(size, &err_msg)) { | 133 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 134 | 0 | if (thread_mem_ctx->wait_gc()) { | 135 | 0 | int64_t wait_milliseconds = 0; | 136 | 0 | LOG(INFO) << fmt::format( | 137 | 0 | "Task:{} waiting for enough memory in thread id:{}, maximum {}ms, {}.", | 138 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 139 | 0 | doris::ThreadContext::get_thread_id(), | 140 | 0 | doris::config::thread_wait_gc_max_milliseconds, err_msg); | 141 | | | 142 | | // only task thread exceeded memory limit for the first time and wait_gc is true. | 143 | | // TODO, in the future, try to free memory and waiting for memory to be freed in pipeline scheduling. | 144 | 0 | doris::JemallocControl::je_thread_tcache_flush(); | 145 | 0 | doris::MemoryReclamation::je_purge_dirty_pages(); | 146 | |
| 147 | 0 | if (!doris::config::disable_memory_gc) { | 148 | | // Allocator is not aware of whether the query is canceled. | 149 | | // even if the query is canceled, it will not end early. | 150 | | // this may cause query to be cancelled more slowly, but it is not a major problem. | 151 | 0 | while (wait_milliseconds < doris::config::thread_wait_gc_max_milliseconds) { | 152 | 0 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); | 153 | 0 | if (!doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 154 | 0 | doris::GlobalMemoryArbitrator::refresh_interval_memory_growth += size; | 155 | 0 | break; | 156 | 0 | } | 157 | 0 | wait_milliseconds += 100; | 158 | 0 | } | 159 | 0 | } else { | 160 | 0 | wait_milliseconds = doris::config::thread_wait_gc_max_milliseconds; | 161 | 0 | } | 162 | | | 163 | | // If true, it means that after waiting for a while, there is still not enough memory, | 164 | | // and try to throw an exception. | 165 | | // else, enough memory is available, the task continues execute. | 166 | 0 | if (wait_milliseconds >= doris::config::thread_wait_gc_max_milliseconds) { | 167 | | // Make sure to completely wait thread_wait_gc_max_milliseconds only once. | 168 | 0 | thread_mem_ctx->disable_wait_gc(); | 169 | 0 | doris::ProcessProfile::instance()->memory_profile()->print_log_process_usage(); | 170 | | | 171 | | // If the outside will catch the exception, after throwing an exception, | 172 | | // the task will actively cancel itself. | 173 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 174 | 0 | LOG(INFO) << fmt::format( | 175 | 0 | "Task:{} sys memory check failed, throw exception, after waiting for " | 176 | 0 | "memory {}ms, {}.", | 177 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 178 | 0 | err_msg); | 179 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 180 | 0 | } else { | 181 | 0 | LOG(INFO) << fmt::format( | 182 | 0 | "Task:{} sys memory check failed, will continue to execute, cannot " | 183 | 0 | "throw exception, after waiting for memory {}ms, {}.", | 184 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 185 | 0 | err_msg); | 186 | 0 | } | 187 | 0 | } | 188 | 0 | } else if (doris::enable_thread_catch_bad_alloc) { | 189 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 190 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 191 | 0 | } else { | 192 | | LOG(INFO) << fmt::format("{}, no throw exception.", err_msg); | 193 | 0 | } | 194 | 0 | } | 195 | 4 | } |
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm Line | Count | Source | 130 | 4 | check_and_tracking_memory>::sys_memory_check(size_t size) const { | 131 | 4 | std::string err_msg; | 132 | 4 | if (sys_memory_exceed(size, &err_msg)) { | 133 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 134 | 0 | if (thread_mem_ctx->wait_gc()) { | 135 | 0 | int64_t wait_milliseconds = 0; | 136 | 0 | LOG(INFO) << fmt::format( | 137 | 0 | "Task:{} waiting for enough memory in thread id:{}, maximum {}ms, {}.", | 138 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 139 | 0 | doris::ThreadContext::get_thread_id(), | 140 | 0 | doris::config::thread_wait_gc_max_milliseconds, err_msg); | 141 | | | 142 | | // only task thread exceeded memory limit for the first time and wait_gc is true. | 143 | | // TODO, in the future, try to free memory and waiting for memory to be freed in pipeline scheduling. | 144 | 0 | doris::JemallocControl::je_thread_tcache_flush(); | 145 | 0 | doris::MemoryReclamation::je_purge_dirty_pages(); | 146 | |
| 147 | 0 | if (!doris::config::disable_memory_gc) { | 148 | | // Allocator is not aware of whether the query is canceled. | 149 | | // even if the query is canceled, it will not end early. | 150 | | // this may cause query to be cancelled more slowly, but it is not a major problem. | 151 | 0 | while (wait_milliseconds < doris::config::thread_wait_gc_max_milliseconds) { | 152 | 0 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); | 153 | 0 | if (!doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 154 | 0 | doris::GlobalMemoryArbitrator::refresh_interval_memory_growth += size; | 155 | 0 | break; | 156 | 0 | } | 157 | 0 | wait_milliseconds += 100; | 158 | 0 | } | 159 | 0 | } else { | 160 | 0 | wait_milliseconds = doris::config::thread_wait_gc_max_milliseconds; | 161 | 0 | } | 162 | | | 163 | | // If true, it means that after waiting for a while, there is still not enough memory, | 164 | | // and try to throw an exception. | 165 | | // else, enough memory is available, the task continues execute. | 166 | 0 | if (wait_milliseconds >= doris::config::thread_wait_gc_max_milliseconds) { | 167 | | // Make sure to completely wait thread_wait_gc_max_milliseconds only once. | 168 | 0 | thread_mem_ctx->disable_wait_gc(); | 169 | 0 | doris::ProcessProfile::instance()->memory_profile()->print_log_process_usage(); | 170 | | | 171 | | // If the outside will catch the exception, after throwing an exception, | 172 | | // the task will actively cancel itself. | 173 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 174 | 0 | LOG(INFO) << fmt::format( | 175 | 0 | "Task:{} sys memory check failed, throw exception, after waiting for " | 176 | 0 | "memory {}ms, {}.", | 177 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 178 | 0 | err_msg); | 179 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 180 | 0 | } else { | 181 | 0 | LOG(INFO) << fmt::format( | 182 | 0 | "Task:{} sys memory check failed, will continue to execute, cannot " | 183 | 0 | "throw exception, after waiting for memory {}ms, {}.", | 184 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 185 | 0 | err_msg); | 186 | 0 | } | 187 | 0 | } | 188 | 0 | } else if (doris::enable_thread_catch_bad_alloc) { | 189 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 190 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 191 | 0 | } else { | 192 | | LOG(INFO) << fmt::format("{}, no throw exception.", err_msg); | 193 | 0 | } | 194 | 0 | } | 195 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm Line | Count | Source | 130 | 4 | check_and_tracking_memory>::sys_memory_check(size_t size) const { | 131 | 4 | std::string err_msg; | 132 | 4 | if (sys_memory_exceed(size, &err_msg)) { | 133 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 134 | 0 | if (thread_mem_ctx->wait_gc()) { | 135 | 0 | int64_t wait_milliseconds = 0; | 136 | 0 | LOG(INFO) << fmt::format( | 137 | 0 | "Task:{} waiting for enough memory in thread id:{}, maximum {}ms, {}.", | 138 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 139 | 0 | doris::ThreadContext::get_thread_id(), | 140 | 0 | doris::config::thread_wait_gc_max_milliseconds, err_msg); | 141 | | | 142 | | // only task thread exceeded memory limit for the first time and wait_gc is true. | 143 | | // TODO, in the future, try to free memory and waiting for memory to be freed in pipeline scheduling. | 144 | 0 | doris::JemallocControl::je_thread_tcache_flush(); | 145 | 0 | doris::MemoryReclamation::je_purge_dirty_pages(); | 146 | |
| 147 | 0 | if (!doris::config::disable_memory_gc) { | 148 | | // Allocator is not aware of whether the query is canceled. | 149 | | // even if the query is canceled, it will not end early. | 150 | | // this may cause query to be cancelled more slowly, but it is not a major problem. | 151 | 0 | while (wait_milliseconds < doris::config::thread_wait_gc_max_milliseconds) { | 152 | 0 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); | 153 | 0 | if (!doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 154 | 0 | doris::GlobalMemoryArbitrator::refresh_interval_memory_growth += size; | 155 | 0 | break; | 156 | 0 | } | 157 | 0 | wait_milliseconds += 100; | 158 | 0 | } | 159 | 0 | } else { | 160 | 0 | wait_milliseconds = doris::config::thread_wait_gc_max_milliseconds; | 161 | 0 | } | 162 | | | 163 | | // If true, it means that after waiting for a while, there is still not enough memory, | 164 | | // and try to throw an exception. | 165 | | // else, enough memory is available, the task continues execute. | 166 | 0 | if (wait_milliseconds >= doris::config::thread_wait_gc_max_milliseconds) { | 167 | | // Make sure to completely wait thread_wait_gc_max_milliseconds only once. | 168 | 0 | thread_mem_ctx->disable_wait_gc(); | 169 | 0 | doris::ProcessProfile::instance()->memory_profile()->print_log_process_usage(); | 170 | | | 171 | | // If the outside will catch the exception, after throwing an exception, | 172 | | // the task will actively cancel itself. | 173 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 174 | 0 | LOG(INFO) << fmt::format( | 175 | 0 | "Task:{} sys memory check failed, throw exception, after waiting for " | 176 | 0 | "memory {}ms, {}.", | 177 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 178 | 0 | err_msg); | 179 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 180 | 0 | } else { | 181 | 0 | LOG(INFO) << fmt::format( | 182 | 0 | "Task:{} sys memory check failed, will continue to execute, cannot " | 183 | 0 | "throw exception, after waiting for memory {}ms, {}.", | 184 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 185 | 0 | err_msg); | 186 | 0 | } | 187 | 0 | } | 188 | 0 | } else if (doris::enable_thread_catch_bad_alloc) { | 189 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 190 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 191 | 0 | } else { | 192 | | LOG(INFO) << fmt::format("{}, no throw exception.", err_msg); | 193 | 0 | } | 194 | 0 | } | 195 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm Line | Count | Source | 130 | 687k | check_and_tracking_memory>::sys_memory_check(size_t size) const { | 131 | 687k | std::string err_msg; | 132 | 687k | if (sys_memory_exceed(size, &err_msg)) { | 133 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 134 | 0 | if (thread_mem_ctx->wait_gc()) { | 135 | 0 | int64_t wait_milliseconds = 0; | 136 | 0 | LOG(INFO) << fmt::format( | 137 | 0 | "Task:{} waiting for enough memory in thread id:{}, maximum {}ms, {}.", | 138 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 139 | 0 | doris::ThreadContext::get_thread_id(), | 140 | 0 | doris::config::thread_wait_gc_max_milliseconds, err_msg); | 141 | | | 142 | | // only task thread exceeded memory limit for the first time and wait_gc is true. | 143 | | // TODO, in the future, try to free memory and waiting for memory to be freed in pipeline scheduling. | 144 | 0 | doris::JemallocControl::je_thread_tcache_flush(); | 145 | 0 | doris::MemoryReclamation::je_purge_dirty_pages(); | 146 | |
| 147 | 0 | if (!doris::config::disable_memory_gc) { | 148 | | // Allocator is not aware of whether the query is canceled. | 149 | | // even if the query is canceled, it will not end early. | 150 | | // this may cause query to be cancelled more slowly, but it is not a major problem. | 151 | 0 | while (wait_milliseconds < doris::config::thread_wait_gc_max_milliseconds) { | 152 | 0 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); | 153 | 0 | if (!doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 154 | 0 | doris::GlobalMemoryArbitrator::refresh_interval_memory_growth += size; | 155 | 0 | break; | 156 | 0 | } | 157 | 0 | wait_milliseconds += 100; | 158 | 0 | } | 159 | 0 | } else { | 160 | 0 | wait_milliseconds = doris::config::thread_wait_gc_max_milliseconds; | 161 | 0 | } | 162 | | | 163 | | // If true, it means that after waiting for a while, there is still not enough memory, | 164 | | // and try to throw an exception. | 165 | | // else, enough memory is available, the task continues execute. | 166 | 0 | if (wait_milliseconds >= doris::config::thread_wait_gc_max_milliseconds) { | 167 | | // Make sure to completely wait thread_wait_gc_max_milliseconds only once. | 168 | 0 | thread_mem_ctx->disable_wait_gc(); | 169 | 0 | doris::ProcessProfile::instance()->memory_profile()->print_log_process_usage(); | 170 | | | 171 | | // If the outside will catch the exception, after throwing an exception, | 172 | | // the task will actively cancel itself. | 173 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 174 | 0 | LOG(INFO) << fmt::format( | 175 | 0 | "Task:{} sys memory check failed, throw exception, after waiting for " | 176 | 0 | "memory {}ms, {}.", | 177 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 178 | 0 | err_msg); | 179 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 180 | 0 | } else { | 181 | 0 | LOG(INFO) << fmt::format( | 182 | 0 | "Task:{} sys memory check failed, will continue to execute, cannot " | 183 | 0 | "throw exception, after waiting for memory {}ms, {}.", | 184 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 185 | 0 | err_msg); | 186 | 0 | } | 187 | 0 | } | 188 | 0 | } else if (doris::enable_thread_catch_bad_alloc) { | 189 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 190 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 191 | 0 | } else { | 192 | | LOG(INFO) << fmt::format("{}, no throw exception.", err_msg); | 193 | 0 | } | 194 | 0 | } | 195 | 687k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE16sys_memory_checkEm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE16sys_memory_checkEm Line | Count | Source | 130 | 3.48k | check_and_tracking_memory>::sys_memory_check(size_t size) const { | 131 | 3.48k | std::string err_msg; | 132 | 3.48k | if (sys_memory_exceed(size, &err_msg)) { | 133 | 0 | auto* thread_mem_ctx = doris::thread_context()->thread_mem_tracker_mgr.get(); | 134 | 0 | if (thread_mem_ctx->wait_gc()) { | 135 | 0 | int64_t wait_milliseconds = 0; | 136 | 0 | LOG(INFO) << fmt::format( | 137 | 0 | "Task:{} waiting for enough memory in thread id:{}, maximum {}ms, {}.", | 138 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), | 139 | 0 | doris::ThreadContext::get_thread_id(), | 140 | 0 | doris::config::thread_wait_gc_max_milliseconds, err_msg); | 141 | | | 142 | | // only task thread exceeded memory limit for the first time and wait_gc is true. | 143 | | // TODO, in the future, try to free memory and waiting for memory to be freed in pipeline scheduling. | 144 | 0 | doris::JemallocControl::je_thread_tcache_flush(); | 145 | 0 | doris::MemoryReclamation::je_purge_dirty_pages(); | 146 | |
| 147 | 0 | if (!doris::config::disable_memory_gc) { | 148 | | // Allocator is not aware of whether the query is canceled. | 149 | | // even if the query is canceled, it will not end early. | 150 | | // this may cause query to be cancelled more slowly, but it is not a major problem. | 151 | 0 | while (wait_milliseconds < doris::config::thread_wait_gc_max_milliseconds) { | 152 | 0 | std::this_thread::sleep_for(std::chrono::milliseconds(100)); | 153 | 0 | if (!doris::GlobalMemoryArbitrator::is_exceed_hard_mem_limit(size)) { | 154 | 0 | doris::GlobalMemoryArbitrator::refresh_interval_memory_growth += size; | 155 | 0 | break; | 156 | 0 | } | 157 | 0 | wait_milliseconds += 100; | 158 | 0 | } | 159 | 0 | } else { | 160 | 0 | wait_milliseconds = doris::config::thread_wait_gc_max_milliseconds; | 161 | 0 | } | 162 | | | 163 | | // If true, it means that after waiting for a while, there is still not enough memory, | 164 | | // and try to throw an exception. | 165 | | // else, enough memory is available, the task continues execute. | 166 | 0 | if (wait_milliseconds >= doris::config::thread_wait_gc_max_milliseconds) { | 167 | | // Make sure to completely wait thread_wait_gc_max_milliseconds only once. | 168 | 0 | thread_mem_ctx->disable_wait_gc(); | 169 | 0 | doris::ProcessProfile::instance()->memory_profile()->print_log_process_usage(); | 170 | | | 171 | | // If the outside will catch the exception, after throwing an exception, | 172 | | // the task will actively cancel itself. | 173 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 174 | 0 | LOG(INFO) << fmt::format( | 175 | 0 | "Task:{} sys memory check failed, throw exception, after waiting for " | 176 | 0 | "memory {}ms, {}.", | 177 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 178 | 0 | err_msg); | 179 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 180 | 0 | } else { | 181 | 0 | LOG(INFO) << fmt::format( | 182 | 0 | "Task:{} sys memory check failed, will continue to execute, cannot " | 183 | 0 | "throw exception, after waiting for memory {}ms, {}.", | 184 | 0 | thread_mem_ctx->limiter_mem_tracker()->label(), wait_milliseconds, | 185 | 0 | err_msg); | 186 | 0 | } | 187 | 0 | } | 188 | 0 | } else if (doris::enable_thread_catch_bad_alloc) { | 189 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 190 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 191 | 0 | } else { | 192 | | LOG(INFO) << fmt::format("{}, no throw exception.", err_msg); | 193 | 0 | } | 194 | 0 | } | 195 | 3.48k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE16sys_memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE16sys_memory_checkEm |
196 | | |
197 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
198 | | bool check_and_tracking_memory> |
199 | | bool Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
200 | | check_and_tracking_memory>::memory_tracker_exceed(size_t size, |
201 | 2.86M | std::string* err_msg) const { |
202 | 2.86M | #ifdef BE_TEST |
203 | 2.86M | if (!doris::pthread_context_ptr_init) { |
204 | 20.3k | return false; |
205 | 20.3k | } |
206 | 2.84M | #endif |
207 | 2.84M | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { |
208 | 0 | return false; |
209 | 0 | } |
210 | | |
211 | 2.84M | auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit( |
212 | 2.84M | size); |
213 | 2.84M | if (!st) { |
214 | 0 | *err_msg += fmt::format("Allocator mem tracker check failed, {}", st.to_string()); |
215 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->print_log_usage( |
216 | 0 | *err_msg); |
217 | 0 | return true; |
218 | 0 | } |
219 | 2.84M | return false; |
220 | 2.84M | } _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 201 | 4 | std::string* err_msg) const { | 202 | 4 | #ifdef BE_TEST | 203 | 4 | if (!doris::pthread_context_ptr_init) { | 204 | 0 | return false; | 205 | 0 | } | 206 | 4 | #endif | 207 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 208 | 0 | return false; | 209 | 0 | } | 210 | | | 211 | 4 | auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit( | 212 | 4 | size); | 213 | 4 | if (!st) { | 214 | 0 | *err_msg += fmt::format("Allocator mem tracker check failed, {}", st.to_string()); | 215 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->print_log_usage( | 216 | 0 | *err_msg); | 217 | 0 | return true; | 218 | 0 | } | 219 | 4 | return false; | 220 | 4 | } |
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 201 | 844 | std::string* err_msg) const { | 202 | 844 | #ifdef BE_TEST | 203 | 844 | if (!doris::pthread_context_ptr_init) { | 204 | 0 | return false; | 205 | 0 | } | 206 | 844 | #endif | 207 | 844 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 208 | 0 | return false; | 209 | 0 | } | 210 | | | 211 | 844 | auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit( | 212 | 844 | size); | 213 | 844 | if (!st) { | 214 | 0 | *err_msg += fmt::format("Allocator mem tracker check failed, {}", st.to_string()); | 215 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->print_log_usage( | 216 | 0 | *err_msg); | 217 | 0 | return true; | 218 | 0 | } | 219 | 844 | return false; | 220 | 844 | } |
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 201 | 4 | std::string* err_msg) const { | 202 | 4 | #ifdef BE_TEST | 203 | 4 | if (!doris::pthread_context_ptr_init) { | 204 | 0 | return false; | 205 | 0 | } | 206 | 4 | #endif | 207 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 208 | 0 | return false; | 209 | 0 | } | 210 | | | 211 | 4 | auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit( | 212 | 4 | size); | 213 | 4 | if (!st) { | 214 | 0 | *err_msg += fmt::format("Allocator mem tracker check failed, {}", st.to_string()); | 215 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->print_log_usage( | 216 | 0 | *err_msg); | 217 | 0 | return true; | 218 | 0 | } | 219 | 4 | return false; | 220 | 4 | } |
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 201 | 22.2k | std::string* err_msg) const { | 202 | 22.2k | #ifdef BE_TEST | 203 | 22.2k | if (!doris::pthread_context_ptr_init) { | 204 | 300 | return false; | 205 | 300 | } | 206 | 21.9k | #endif | 207 | 21.9k | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 208 | 0 | return false; | 209 | 0 | } | 210 | | | 211 | 21.9k | auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit( | 212 | 21.9k | size); | 213 | 21.9k | if (!st) { | 214 | 0 | *err_msg += fmt::format("Allocator mem tracker check failed, {}", st.to_string()); | 215 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->print_log_usage( | 216 | 0 | *err_msg); | 217 | 0 | return true; | 218 | 0 | } | 219 | 21.9k | return false; | 220 | 21.9k | } |
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 201 | 4 | std::string* err_msg) const { | 202 | 4 | #ifdef BE_TEST | 203 | 4 | if (!doris::pthread_context_ptr_init) { | 204 | 0 | return false; | 205 | 0 | } | 206 | 4 | #endif | 207 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 208 | 0 | return false; | 209 | 0 | } | 210 | | | 211 | 4 | auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit( | 212 | 4 | size); | 213 | 4 | if (!st) { | 214 | 0 | *err_msg += fmt::format("Allocator mem tracker check failed, {}", st.to_string()); | 215 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->print_log_usage( | 216 | 0 | *err_msg); | 217 | 0 | return true; | 218 | 0 | } | 219 | 4 | return false; | 220 | 4 | } |
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 201 | 4 | std::string* err_msg) const { | 202 | 4 | #ifdef BE_TEST | 203 | 4 | if (!doris::pthread_context_ptr_init) { | 204 | 0 | return false; | 205 | 0 | } | 206 | 4 | #endif | 207 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 208 | 0 | return false; | 209 | 0 | } | 210 | | | 211 | 4 | auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit( | 212 | 4 | size); | 213 | 4 | if (!st) { | 214 | 0 | *err_msg += fmt::format("Allocator mem tracker check failed, {}", st.to_string()); | 215 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->print_log_usage( | 216 | 0 | *err_msg); | 217 | 0 | return true; | 218 | 0 | } | 219 | 4 | return false; | 220 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 201 | 4 | std::string* err_msg) const { | 202 | 4 | #ifdef BE_TEST | 203 | 4 | if (!doris::pthread_context_ptr_init) { | 204 | 0 | return false; | 205 | 0 | } | 206 | 4 | #endif | 207 | 4 | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 208 | 0 | return false; | 209 | 0 | } | 210 | | | 211 | 4 | auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit( | 212 | 4 | size); | 213 | 4 | if (!st) { | 214 | 0 | *err_msg += fmt::format("Allocator mem tracker check failed, {}", st.to_string()); | 215 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->print_log_usage( | 216 | 0 | *err_msg); | 217 | 0 | return true; | 218 | 0 | } | 219 | 4 | return false; | 220 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 201 | 687k | std::string* err_msg) const { | 202 | 687k | #ifdef BE_TEST | 203 | 687k | if (!doris::pthread_context_ptr_init) { | 204 | 100 | return false; | 205 | 100 | } | 206 | 687k | #endif | 207 | 687k | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 208 | 0 | return false; | 209 | 0 | } | 210 | | | 211 | 687k | auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit( | 212 | 687k | size); | 213 | 687k | if (!st) { | 214 | 0 | *err_msg += fmt::format("Allocator mem tracker check failed, {}", st.to_string()); | 215 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->print_log_usage( | 216 | 0 | *err_msg); | 217 | 0 | return true; | 218 | 0 | } | 219 | 687k | return false; | 220 | 687k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 201 | 2.14M | std::string* err_msg) const { | 202 | 2.14M | #ifdef BE_TEST | 203 | 2.14M | if (!doris::pthread_context_ptr_init) { | 204 | 19.9k | return false; | 205 | 19.9k | } | 206 | 2.12M | #endif | 207 | 2.12M | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 208 | 0 | return false; | 209 | 0 | } | 210 | | | 211 | 2.12M | auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit( | 212 | 2.12M | size); | 213 | 2.12M | if (!st) { | 214 | 0 | *err_msg += fmt::format("Allocator mem tracker check failed, {}", st.to_string()); | 215 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->print_log_usage( | 216 | 0 | *err_msg); | 217 | 0 | return true; | 218 | 0 | } | 219 | 2.12M | return false; | 220 | 2.12M | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Line | Count | Source | 201 | 3.48k | std::string* err_msg) const { | 202 | 3.48k | #ifdef BE_TEST | 203 | 3.48k | if (!doris::pthread_context_ptr_init) { | 204 | 0 | return false; | 205 | 0 | } | 206 | 3.48k | #endif | 207 | 3.48k | if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) { | 208 | 0 | return false; | 209 | 0 | } | 210 | | | 211 | 3.48k | auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit( | 212 | 3.48k | size); | 213 | 3.48k | if (!st) { | 214 | 0 | *err_msg += fmt::format("Allocator mem tracker check failed, {}", st.to_string()); | 215 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->print_log_usage( | 216 | 0 | *err_msg); | 217 | 0 | return true; | 218 | 0 | } | 219 | 3.48k | return false; | 220 | 3.48k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE |
221 | | |
222 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
223 | | bool check_and_tracking_memory> |
224 | | void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
225 | 714k | check_and_tracking_memory>::memory_tracker_check(size_t size) const { |
226 | 714k | std::string err_msg; |
227 | 714k | if (memory_tracker_exceed(size, &err_msg)) { |
228 | 0 | doris::thread_context()->thread_mem_tracker_mgr->disable_wait_gc(); |
229 | | // If the outside will catch the exception, after throwing an exception, |
230 | | // the task will actively cancel itself. |
231 | 0 | if (doris::enable_thread_catch_bad_alloc) { |
232 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); |
233 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); |
234 | 0 | } else { |
235 | 0 | LOG(INFO) << fmt::format("{}, will continue to execute, no throw exception.", err_msg); |
236 | 0 | } |
237 | 0 | } |
238 | 714k | } _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm Line | Count | Source | 225 | 4 | check_and_tracking_memory>::memory_tracker_check(size_t size) const { | 226 | 4 | std::string err_msg; | 227 | 4 | if (memory_tracker_exceed(size, &err_msg)) { | 228 | 0 | doris::thread_context()->thread_mem_tracker_mgr->disable_wait_gc(); | 229 | | // If the outside will catch the exception, after throwing an exception, | 230 | | // the task will actively cancel itself. | 231 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 232 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 233 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 234 | 0 | } else { | 235 | | LOG(INFO) << fmt::format("{}, will continue to execute, no throw exception.", err_msg); | 236 | 0 | } | 237 | 0 | } | 238 | 4 | } |
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm Line | Count | Source | 225 | 844 | check_and_tracking_memory>::memory_tracker_check(size_t size) const { | 226 | 844 | std::string err_msg; | 227 | 844 | if (memory_tracker_exceed(size, &err_msg)) { | 228 | 0 | doris::thread_context()->thread_mem_tracker_mgr->disable_wait_gc(); | 229 | | // If the outside will catch the exception, after throwing an exception, | 230 | | // the task will actively cancel itself. | 231 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 232 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 233 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 234 | 0 | } else { | 235 | | LOG(INFO) << fmt::format("{}, will continue to execute, no throw exception.", err_msg); | 236 | 0 | } | 237 | 0 | } | 238 | 844 | } |
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm Line | Count | Source | 225 | 4 | check_and_tracking_memory>::memory_tracker_check(size_t size) const { | 226 | 4 | std::string err_msg; | 227 | 4 | if (memory_tracker_exceed(size, &err_msg)) { | 228 | 0 | doris::thread_context()->thread_mem_tracker_mgr->disable_wait_gc(); | 229 | | // If the outside will catch the exception, after throwing an exception, | 230 | | // the task will actively cancel itself. | 231 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 232 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 233 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 234 | 0 | } else { | 235 | | LOG(INFO) << fmt::format("{}, will continue to execute, no throw exception.", err_msg); | 236 | 0 | } | 237 | 0 | } | 238 | 4 | } |
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm Line | Count | Source | 225 | 22.2k | check_and_tracking_memory>::memory_tracker_check(size_t size) const { | 226 | 22.2k | std::string err_msg; | 227 | 22.2k | if (memory_tracker_exceed(size, &err_msg)) { | 228 | 0 | doris::thread_context()->thread_mem_tracker_mgr->disable_wait_gc(); | 229 | | // If the outside will catch the exception, after throwing an exception, | 230 | | // the task will actively cancel itself. | 231 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 232 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 233 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 234 | 0 | } else { | 235 | | LOG(INFO) << fmt::format("{}, will continue to execute, no throw exception.", err_msg); | 236 | 0 | } | 237 | 0 | } | 238 | 22.2k | } |
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm Line | Count | Source | 225 | 4 | check_and_tracking_memory>::memory_tracker_check(size_t size) const { | 226 | 4 | std::string err_msg; | 227 | 4 | if (memory_tracker_exceed(size, &err_msg)) { | 228 | 0 | doris::thread_context()->thread_mem_tracker_mgr->disable_wait_gc(); | 229 | | // If the outside will catch the exception, after throwing an exception, | 230 | | // the task will actively cancel itself. | 231 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 232 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 233 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 234 | 0 | } else { | 235 | | LOG(INFO) << fmt::format("{}, will continue to execute, no throw exception.", err_msg); | 236 | 0 | } | 237 | 0 | } | 238 | 4 | } |
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm Line | Count | Source | 225 | 4 | check_and_tracking_memory>::memory_tracker_check(size_t size) const { | 226 | 4 | std::string err_msg; | 227 | 4 | if (memory_tracker_exceed(size, &err_msg)) { | 228 | 0 | doris::thread_context()->thread_mem_tracker_mgr->disable_wait_gc(); | 229 | | // If the outside will catch the exception, after throwing an exception, | 230 | | // the task will actively cancel itself. | 231 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 232 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 233 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 234 | 0 | } else { | 235 | | LOG(INFO) << fmt::format("{}, will continue to execute, no throw exception.", err_msg); | 236 | 0 | } | 237 | 0 | } | 238 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm Line | Count | Source | 225 | 4 | check_and_tracking_memory>::memory_tracker_check(size_t size) const { | 226 | 4 | std::string err_msg; | 227 | 4 | if (memory_tracker_exceed(size, &err_msg)) { | 228 | 0 | doris::thread_context()->thread_mem_tracker_mgr->disable_wait_gc(); | 229 | | // If the outside will catch the exception, after throwing an exception, | 230 | | // the task will actively cancel itself. | 231 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 232 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 233 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 234 | 0 | } else { | 235 | | LOG(INFO) << fmt::format("{}, will continue to execute, no throw exception.", err_msg); | 236 | 0 | } | 237 | 0 | } | 238 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm Line | Count | Source | 225 | 687k | check_and_tracking_memory>::memory_tracker_check(size_t size) const { | 226 | 687k | std::string err_msg; | 227 | 687k | if (memory_tracker_exceed(size, &err_msg)) { | 228 | 0 | doris::thread_context()->thread_mem_tracker_mgr->disable_wait_gc(); | 229 | | // If the outside will catch the exception, after throwing an exception, | 230 | | // the task will actively cancel itself. | 231 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 232 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 233 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 234 | 0 | } else { | 235 | | LOG(INFO) << fmt::format("{}, will continue to execute, no throw exception.", err_msg); | 236 | 0 | } | 237 | 0 | } | 238 | 687k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE20memory_tracker_checkEm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE20memory_tracker_checkEm Line | Count | Source | 225 | 3.48k | check_and_tracking_memory>::memory_tracker_check(size_t size) const { | 226 | 3.48k | std::string err_msg; | 227 | 3.48k | if (memory_tracker_exceed(size, &err_msg)) { | 228 | 0 | doris::thread_context()->thread_mem_tracker_mgr->disable_wait_gc(); | 229 | | // If the outside will catch the exception, after throwing an exception, | 230 | | // the task will actively cancel itself. | 231 | 0 | if (doris::enable_thread_catch_bad_alloc) { | 232 | 0 | LOG(INFO) << fmt::format("{}, throw exception.", err_msg); | 233 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err_msg); | 234 | 0 | } else { | 235 | | LOG(INFO) << fmt::format("{}, will continue to execute, no throw exception.", err_msg); | 236 | 0 | } | 237 | 0 | } | 238 | 3.48k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE20memory_tracker_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE20memory_tracker_checkEm |
239 | | |
240 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
241 | | bool check_and_tracking_memory> |
242 | | void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
243 | 3.04M | check_and_tracking_memory>::memory_check(size_t size) const { |
244 | 3.04M | if (check_and_tracking_memory) { |
245 | 714k | alloc_fault_probability(); |
246 | 714k | sys_memory_check(size); |
247 | 714k | memory_tracker_check(size); |
248 | 714k | } |
249 | 3.04M | } _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm Line | Count | Source | 243 | 4 | check_and_tracking_memory>::memory_check(size_t size) const { | 244 | 4 | if (check_and_tracking_memory) { | 245 | 4 | alloc_fault_probability(); | 246 | 4 | sys_memory_check(size); | 247 | 4 | memory_tracker_check(size); | 248 | 4 | } | 249 | 4 | } |
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm Line | Count | Source | 243 | 844 | check_and_tracking_memory>::memory_check(size_t size) const { | 244 | 844 | if (check_and_tracking_memory) { | 245 | 844 | alloc_fault_probability(); | 246 | 844 | sys_memory_check(size); | 247 | 844 | memory_tracker_check(size); | 248 | 844 | } | 249 | 844 | } |
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm Line | Count | Source | 243 | 4 | check_and_tracking_memory>::memory_check(size_t size) const { | 244 | 4 | if (check_and_tracking_memory) { | 245 | 4 | alloc_fault_probability(); | 246 | 4 | sys_memory_check(size); | 247 | 4 | memory_tracker_check(size); | 248 | 4 | } | 249 | 4 | } |
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm Line | Count | Source | 243 | 22.2k | check_and_tracking_memory>::memory_check(size_t size) const { | 244 | 22.2k | if (check_and_tracking_memory) { | 245 | 22.2k | alloc_fault_probability(); | 246 | 22.2k | sys_memory_check(size); | 247 | 22.2k | memory_tracker_check(size); | 248 | 22.2k | } | 249 | 22.2k | } |
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm Line | Count | Source | 243 | 4 | check_and_tracking_memory>::memory_check(size_t size) const { | 244 | 4 | if (check_and_tracking_memory) { | 245 | 4 | alloc_fault_probability(); | 246 | 4 | sys_memory_check(size); | 247 | 4 | memory_tracker_check(size); | 248 | 4 | } | 249 | 4 | } |
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm Line | Count | Source | 243 | 4 | check_and_tracking_memory>::memory_check(size_t size) const { | 244 | 4 | if (check_and_tracking_memory) { | 245 | 4 | alloc_fault_probability(); | 246 | 4 | sys_memory_check(size); | 247 | 4 | memory_tracker_check(size); | 248 | 4 | } | 249 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm Line | Count | Source | 243 | 4 | check_and_tracking_memory>::memory_check(size_t size) const { | 244 | 4 | if (check_and_tracking_memory) { | 245 | 4 | alloc_fault_probability(); | 246 | 4 | sys_memory_check(size); | 247 | 4 | memory_tracker_check(size); | 248 | 4 | } | 249 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm Line | Count | Source | 243 | 687k | check_and_tracking_memory>::memory_check(size_t size) const { | 244 | 687k | if (check_and_tracking_memory) { | 245 | 687k | alloc_fault_probability(); | 246 | 687k | sys_memory_check(size); | 247 | 687k | memory_tracker_check(size); | 248 | 687k | } | 249 | 687k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE12memory_checkEm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE12memory_checkEm Line | Count | Source | 243 | 2.33M | check_and_tracking_memory>::memory_check(size_t size) const { | 244 | 2.33M | if (check_and_tracking_memory) { | 245 | 0 | alloc_fault_probability(); | 246 | 0 | sys_memory_check(size); | 247 | 0 | memory_tracker_check(size); | 248 | 0 | } | 249 | 2.33M | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE12memory_checkEm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE12memory_checkEm Line | Count | Source | 243 | 3.48k | check_and_tracking_memory>::memory_check(size_t size) const { | 244 | 3.48k | if (check_and_tracking_memory) { | 245 | 3.48k | alloc_fault_probability(); | 246 | 3.48k | sys_memory_check(size); | 247 | 3.48k | memory_tracker_check(size); | 248 | 3.48k | } | 249 | 3.48k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE12memory_checkEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE12memory_checkEm |
250 | | |
251 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
252 | | bool check_and_tracking_memory> |
253 | | void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
254 | 3.04M | check_and_tracking_memory>::consume_memory(size_t size) const { |
255 | 3.04M | if (check_and_tracking_memory) { |
256 | 714k | CONSUME_THREAD_MEM_TRACKER(size); |
257 | 714k | } |
258 | 3.04M | } _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm Line | Count | Source | 254 | 4 | check_and_tracking_memory>::consume_memory(size_t size) const { | 255 | 4 | if (check_and_tracking_memory) { | 256 | | CONSUME_THREAD_MEM_TRACKER(size); | 257 | 4 | } | 258 | 4 | } |
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm Line | Count | Source | 254 | 844 | check_and_tracking_memory>::consume_memory(size_t size) const { | 255 | 844 | if (check_and_tracking_memory) { | 256 | | CONSUME_THREAD_MEM_TRACKER(size); | 257 | 844 | } | 258 | 844 | } |
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm Line | Count | Source | 254 | 4 | check_and_tracking_memory>::consume_memory(size_t size) const { | 255 | 4 | if (check_and_tracking_memory) { | 256 | | CONSUME_THREAD_MEM_TRACKER(size); | 257 | 4 | } | 258 | 4 | } |
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm Line | Count | Source | 254 | 22.2k | check_and_tracking_memory>::consume_memory(size_t size) const { | 255 | 22.2k | if (check_and_tracking_memory) { | 256 | | CONSUME_THREAD_MEM_TRACKER(size); | 257 | 22.2k | } | 258 | 22.2k | } |
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm Line | Count | Source | 254 | 4 | check_and_tracking_memory>::consume_memory(size_t size) const { | 255 | 4 | if (check_and_tracking_memory) { | 256 | | CONSUME_THREAD_MEM_TRACKER(size); | 257 | 4 | } | 258 | 4 | } |
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm Line | Count | Source | 254 | 4 | check_and_tracking_memory>::consume_memory(size_t size) const { | 255 | 4 | if (check_and_tracking_memory) { | 256 | | CONSUME_THREAD_MEM_TRACKER(size); | 257 | 4 | } | 258 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm Line | Count | Source | 254 | 4 | check_and_tracking_memory>::consume_memory(size_t size) const { | 255 | 4 | if (check_and_tracking_memory) { | 256 | | CONSUME_THREAD_MEM_TRACKER(size); | 257 | 4 | } | 258 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm Line | Count | Source | 254 | 687k | check_and_tracking_memory>::consume_memory(size_t size) const { | 255 | 687k | if (check_and_tracking_memory) { | 256 | | CONSUME_THREAD_MEM_TRACKER(size); | 257 | 687k | } | 258 | 687k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE14consume_memoryEm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE14consume_memoryEm Line | Count | Source | 254 | 2.33M | check_and_tracking_memory>::consume_memory(size_t size) const { | 255 | 2.33M | if (check_and_tracking_memory) { | 256 | | CONSUME_THREAD_MEM_TRACKER(size); | 257 | 0 | } | 258 | 2.33M | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE14consume_memoryEm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE14consume_memoryEm Line | Count | Source | 254 | 3.48k | check_and_tracking_memory>::consume_memory(size_t size) const { | 255 | 3.48k | if (check_and_tracking_memory) { | 256 | | CONSUME_THREAD_MEM_TRACKER(size); | 257 | 3.48k | } | 258 | 3.48k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE14consume_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE14consume_memoryEm |
259 | | |
260 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
261 | | bool check_and_tracking_memory> |
262 | | void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
263 | 3.04M | check_and_tracking_memory>::release_memory(size_t size) const { |
264 | 3.04M | if (check_and_tracking_memory) { |
265 | 709k | RELEASE_THREAD_MEM_TRACKER(size); |
266 | 709k | } |
267 | 3.04M | } _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm Line | Count | Source | 263 | 4 | check_and_tracking_memory>::release_memory(size_t size) const { | 264 | 4 | if (check_and_tracking_memory) { | 265 | | RELEASE_THREAD_MEM_TRACKER(size); | 266 | 4 | } | 267 | 4 | } |
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm Line | Count | Source | 263 | 844 | check_and_tracking_memory>::release_memory(size_t size) const { | 264 | 844 | if (check_and_tracking_memory) { | 265 | | RELEASE_THREAD_MEM_TRACKER(size); | 266 | 844 | } | 267 | 844 | } |
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm Line | Count | Source | 263 | 4 | check_and_tracking_memory>::release_memory(size_t size) const { | 264 | 4 | if (check_and_tracking_memory) { | 265 | | RELEASE_THREAD_MEM_TRACKER(size); | 266 | 4 | } | 267 | 4 | } |
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm Line | Count | Source | 263 | 22.2k | check_and_tracking_memory>::release_memory(size_t size) const { | 264 | 22.2k | if (check_and_tracking_memory) { | 265 | | RELEASE_THREAD_MEM_TRACKER(size); | 266 | 22.2k | } | 267 | 22.2k | } |
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm Line | Count | Source | 263 | 4 | check_and_tracking_memory>::release_memory(size_t size) const { | 264 | 4 | if (check_and_tracking_memory) { | 265 | | RELEASE_THREAD_MEM_TRACKER(size); | 266 | 4 | } | 267 | 4 | } |
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm Line | Count | Source | 263 | 4 | check_and_tracking_memory>::release_memory(size_t size) const { | 264 | 4 | if (check_and_tracking_memory) { | 265 | | RELEASE_THREAD_MEM_TRACKER(size); | 266 | 4 | } | 267 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm Line | Count | Source | 263 | 4 | check_and_tracking_memory>::release_memory(size_t size) const { | 264 | 4 | if (check_and_tracking_memory) { | 265 | | RELEASE_THREAD_MEM_TRACKER(size); | 266 | 4 | } | 267 | 4 | } |
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm Line | Count | Source | 263 | 682k | check_and_tracking_memory>::release_memory(size_t size) const { | 264 | 682k | if (check_and_tracking_memory) { | 265 | | RELEASE_THREAD_MEM_TRACKER(size); | 266 | 682k | } | 267 | 682k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE14release_memoryEm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE14release_memoryEm Line | Count | Source | 263 | 2.33M | check_and_tracking_memory>::release_memory(size_t size) const { | 264 | 2.33M | if (check_and_tracking_memory) { | 265 | | RELEASE_THREAD_MEM_TRACKER(size); | 266 | 0 | } | 267 | 2.33M | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE14release_memoryEm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE14release_memoryEm Line | Count | Source | 263 | 3.48k | check_and_tracking_memory>::release_memory(size_t size) const { | 264 | 3.48k | if (check_and_tracking_memory) { | 265 | | RELEASE_THREAD_MEM_TRACKER(size); | 266 | 3.48k | } | 267 | 3.48k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE14release_memoryEm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE14release_memoryEm |
268 | | |
269 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
270 | | bool check_and_tracking_memory> |
271 | | void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
272 | 0 | check_and_tracking_memory>::throw_bad_alloc(const std::string& err) const { |
273 | 0 | LOG(WARNING) << err |
274 | 0 | << fmt::format("{}, Stacktrace: {}", |
275 | 0 | doris::GlobalMemoryArbitrator::process_mem_log_str(), |
276 | 0 | doris::get_stack_trace()); |
277 | 0 | doris::ProcessProfile::instance()->memory_profile()->print_log_process_usage(); |
278 | 0 | throw doris::Exception(doris::ErrorCode::MEM_ALLOC_FAILED, err); |
279 | 0 | } Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE15throw_bad_allocERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE |
280 | | |
281 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
282 | | bool check_and_tracking_memory> |
283 | | void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
284 | 3.04M | check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const { |
285 | 3.04M | if (!doris::config::crash_in_memory_tracker_inaccurate) { |
286 | 3.04M | return; |
287 | 3.04M | } |
288 | 18.4E | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers( |
289 | 18.4E | buf, size); |
290 | 18.4E | } _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE22add_address_sanitizersEPvm Line | Count | Source | 284 | 4 | check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const { | 285 | 4 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 286 | 4 | return; | 287 | 4 | } | 288 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers( | 289 | 0 | buf, size); | 290 | 0 | } |
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE22add_address_sanitizersEPvm Line | Count | Source | 284 | 844 | check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const { | 285 | 844 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 286 | 844 | return; | 287 | 844 | } | 288 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers( | 289 | 0 | buf, size); | 290 | 0 | } |
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE22add_address_sanitizersEPvm Line | Count | Source | 284 | 4 | check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const { | 285 | 4 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 286 | 4 | return; | 287 | 4 | } | 288 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers( | 289 | 0 | buf, size); | 290 | 0 | } |
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE22add_address_sanitizersEPvm Line | Count | Source | 284 | 22.2k | check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const { | 285 | 22.2k | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 286 | 22.2k | return; | 287 | 22.2k | } | 288 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers( | 289 | 0 | buf, size); | 290 | 0 | } |
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE22add_address_sanitizersEPvm Line | Count | Source | 284 | 4 | check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const { | 285 | 4 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 286 | 4 | return; | 287 | 4 | } | 288 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers( | 289 | 0 | buf, size); | 290 | 0 | } |
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE22add_address_sanitizersEPvm Line | Count | Source | 284 | 4 | check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const { | 285 | 4 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 286 | 4 | return; | 287 | 4 | } | 288 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers( | 289 | 0 | buf, size); | 290 | 0 | } |
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE22add_address_sanitizersEPvm Line | Count | Source | 284 | 4 | check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const { | 285 | 4 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 286 | 4 | return; | 287 | 4 | } | 288 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers( | 289 | 0 | buf, size); | 290 | 0 | } |
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE22add_address_sanitizersEPvm Line | Count | Source | 284 | 687k | check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const { | 285 | 687k | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 286 | 687k | return; | 287 | 687k | } | 288 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers( | 289 | 0 | buf, size); | 290 | 0 | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE22add_address_sanitizersEPvm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE22add_address_sanitizersEPvm Line | Count | Source | 284 | 2.33M | check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const { | 285 | 2.33M | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 286 | 2.33M | return; | 287 | 2.33M | } | 288 | 18.4E | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers( | 289 | 18.4E | buf, size); | 290 | 18.4E | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE22add_address_sanitizersEPvm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE22add_address_sanitizersEPvm Line | Count | Source | 284 | 3.48k | check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const { | 285 | 3.48k | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 286 | 3.48k | return; | 287 | 3.48k | } | 288 | 0 | doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers( | 289 | 0 | buf, size); | 290 | 0 | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE22add_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE22add_address_sanitizersEPvm |
291 | | |
292 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
293 | | bool check_and_tracking_memory> |
294 | | void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
295 | 3.04M | check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const { |
296 | 3.04M | if (!doris::config::crash_in_memory_tracker_inaccurate) { |
297 | 3.04M | return; |
298 | 3.04M | } |
299 | 15 | doris::thread_context() |
300 | 15 | ->thread_mem_tracker_mgr->limiter_mem_tracker() |
301 | 15 | ->remove_address_sanitizers(buf, size); |
302 | 15 | } _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Line | Count | Source | 295 | 4 | check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const { | 296 | 4 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 297 | 4 | return; | 298 | 4 | } | 299 | 0 | doris::thread_context() | 300 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 301 | 0 | ->remove_address_sanitizers(buf, size); | 302 | 0 | } |
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Line | Count | Source | 295 | 844 | check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const { | 296 | 844 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 297 | 844 | return; | 298 | 844 | } | 299 | 0 | doris::thread_context() | 300 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 301 | 0 | ->remove_address_sanitizers(buf, size); | 302 | 0 | } |
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Line | Count | Source | 295 | 4 | check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const { | 296 | 4 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 297 | 4 | return; | 298 | 4 | } | 299 | 0 | doris::thread_context() | 300 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 301 | 0 | ->remove_address_sanitizers(buf, size); | 302 | 0 | } |
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Line | Count | Source | 295 | 22.2k | check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const { | 296 | 22.2k | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 297 | 22.2k | return; | 298 | 22.2k | } | 299 | 0 | doris::thread_context() | 300 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 301 | 0 | ->remove_address_sanitizers(buf, size); | 302 | 0 | } |
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Line | Count | Source | 295 | 4 | check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const { | 296 | 4 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 297 | 4 | return; | 298 | 4 | } | 299 | 0 | doris::thread_context() | 300 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 301 | 0 | ->remove_address_sanitizers(buf, size); | 302 | 0 | } |
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Line | Count | Source | 295 | 4 | check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const { | 296 | 4 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 297 | 4 | return; | 298 | 4 | } | 299 | 0 | doris::thread_context() | 300 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 301 | 0 | ->remove_address_sanitizers(buf, size); | 302 | 0 | } |
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Line | Count | Source | 295 | 4 | check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const { | 296 | 4 | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 297 | 4 | return; | 298 | 4 | } | 299 | 0 | doris::thread_context() | 300 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 301 | 0 | ->remove_address_sanitizers(buf, size); | 302 | 0 | } |
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Line | Count | Source | 295 | 682k | check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const { | 296 | 682k | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 297 | 682k | return; | 298 | 682k | } | 299 | 0 | doris::thread_context() | 300 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 301 | 0 | ->remove_address_sanitizers(buf, size); | 302 | 0 | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE25remove_address_sanitizersEPvm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Line | Count | Source | 295 | 2.33M | check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const { | 296 | 2.33M | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 297 | 2.33M | return; | 298 | 2.33M | } | 299 | 15 | doris::thread_context() | 300 | 15 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 301 | 15 | ->remove_address_sanitizers(buf, size); | 302 | 15 | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE25remove_address_sanitizersEPvm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE25remove_address_sanitizersEPvm Line | Count | Source | 295 | 3.48k | check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const { | 296 | 3.48k | if (!doris::config::crash_in_memory_tracker_inaccurate) { | 297 | 3.48k | return; | 298 | 3.48k | } | 299 | 0 | doris::thread_context() | 300 | 0 | ->thread_mem_tracker_mgr->limiter_mem_tracker() | 301 | 0 | ->remove_address_sanitizers(buf, size); | 302 | 0 | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE25remove_address_sanitizersEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE25remove_address_sanitizersEPvm |
303 | | |
304 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
305 | | bool check_and_tracking_memory> |
306 | | void* Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
307 | 2.77M | check_and_tracking_memory>::alloc(size_t size, size_t alignment) { |
308 | 2.77M | memory_check(size); |
309 | | // consume memory in tracker before alloc, similar to early declaration. |
310 | 2.77M | consume_memory(size); |
311 | 2.77M | void* buf; |
312 | 2.77M | size_t record_size = size; |
313 | | |
314 | 2.77M | if (use_mmap && size >= doris::config::mmap_threshold) { |
315 | 0 | if (alignment > MMAP_MIN_ALIGNMENT) { |
316 | 0 | throw doris::Exception( |
317 | 0 | doris::ErrorCode::INVALID_ARGUMENT, |
318 | 0 | "Too large alignment {}: more than page size when allocating {}.", alignment, |
319 | 0 | size); |
320 | 0 | } |
321 | | |
322 | 0 | buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); |
323 | 0 | if (MAP_FAILED == buf) { |
324 | 0 | release_memory(size); |
325 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mmap {}.", size)); |
326 | 0 | } |
327 | 0 | if constexpr (MemoryAllocator::need_record_actual_size()) { |
328 | 0 | record_size = MemoryAllocator::allocated_size(buf); |
329 | 0 | } |
330 | | |
331 | | /// No need for zero-fill, because mmap guarantees it. |
332 | 2.77M | } else { |
333 | 2.77M | if (alignment <= MALLOC_MIN_ALIGNMENT) { |
334 | 2.72M | if constexpr (clear_memory) { |
335 | 22.9k | buf = MemoryAllocator::calloc(size, 1); |
336 | 2.70M | } else { |
337 | 2.70M | buf = MemoryAllocator::malloc(size); |
338 | 2.70M | } |
339 | | |
340 | 2.72M | if (nullptr == buf) { |
341 | 0 | release_memory(size); |
342 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size)); |
343 | 0 | } |
344 | 2.72M | if constexpr (MemoryAllocator::need_record_actual_size()) { |
345 | 0 | record_size = MemoryAllocator::allocated_size(buf); |
346 | 0 | } |
347 | 2.72M | add_address_sanitizers(buf, record_size); |
348 | 2.72M | } else { |
349 | 49.5k | buf = nullptr; |
350 | 49.5k | int res = MemoryAllocator::posix_memalign(&buf, alignment, size); |
351 | | |
352 | 49.5k | if (0 != res) { |
353 | 0 | release_memory(size); |
354 | 0 | throw_bad_alloc(fmt::format("Cannot allocate memory (posix_memalign) {}.", size)); |
355 | 0 | } |
356 | | |
357 | 49.5k | if constexpr (clear_memory) { |
358 | 0 | memset(buf, 0, size); |
359 | 0 | } |
360 | | |
361 | 49.5k | if constexpr (MemoryAllocator::need_record_actual_size()) { |
362 | 0 | record_size = MemoryAllocator::allocated_size(buf); |
363 | 0 | } |
364 | 49.5k | add_address_sanitizers(buf, record_size); |
365 | 49.5k | } |
366 | 2.77M | } |
367 | 2.77M | if constexpr (MemoryAllocator::need_record_actual_size()) { |
368 | 0 | consume_memory(record_size - size); |
369 | 0 | } |
370 | 2.77M | return buf; |
371 | 2.77M | } _ZN5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE5allocEmm Line | Count | Source | 307 | 2 | check_and_tracking_memory>::alloc(size_t size, size_t alignment) { | 308 | 2 | memory_check(size); | 309 | | // consume memory in tracker before alloc, similar to early declaration. | 310 | 2 | consume_memory(size); | 311 | 2 | void* buf; | 312 | 2 | size_t record_size = size; | 313 | | | 314 | 2 | if (use_mmap && size >= doris::config::mmap_threshold) { | 315 | 0 | if (alignment > MMAP_MIN_ALIGNMENT) { | 316 | 0 | throw doris::Exception( | 317 | 0 | doris::ErrorCode::INVALID_ARGUMENT, | 318 | 0 | "Too large alignment {}: more than page size when allocating {}.", alignment, | 319 | 0 | size); | 320 | 0 | } | 321 | | | 322 | 0 | buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); | 323 | 0 | if (MAP_FAILED == buf) { | 324 | 0 | release_memory(size); | 325 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mmap {}.", size)); | 326 | 0 | } | 327 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 328 | | record_size = MemoryAllocator::allocated_size(buf); | 329 | | } | 330 | | | 331 | | /// No need for zero-fill, because mmap guarantees it. | 332 | 2 | } else { | 333 | 2 | if (alignment <= MALLOC_MIN_ALIGNMENT) { | 334 | 2 | if constexpr (clear_memory) { | 335 | 2 | buf = MemoryAllocator::calloc(size, 1); | 336 | | } else { | 337 | | buf = MemoryAllocator::malloc(size); | 338 | | } | 339 | | | 340 | 2 | if (nullptr == buf) { | 341 | 0 | release_memory(size); | 342 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size)); | 343 | 0 | } | 344 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 345 | | record_size = MemoryAllocator::allocated_size(buf); | 346 | | } | 347 | 2 | add_address_sanitizers(buf, record_size); | 348 | 2 | } else { | 349 | 0 | buf = nullptr; | 350 | 0 | int res = MemoryAllocator::posix_memalign(&buf, alignment, size); | 351 | |
| 352 | 0 | if (0 != res) { | 353 | 0 | release_memory(size); | 354 | 0 | throw_bad_alloc(fmt::format("Cannot allocate memory (posix_memalign) {}.", size)); | 355 | 0 | } | 356 | |
| 357 | 0 | if constexpr (clear_memory) { | 358 | 0 | memset(buf, 0, size); | 359 | 0 | } | 360 | |
| 361 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 362 | | record_size = MemoryAllocator::allocated_size(buf); | 363 | | } | 364 | 0 | add_address_sanitizers(buf, record_size); | 365 | 0 | } | 366 | 2 | } | 367 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 368 | | consume_memory(record_size - size); | 369 | | } | 370 | 2 | return buf; | 371 | 2 | } |
_ZN5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE5allocEmm Line | Count | Source | 307 | 712 | check_and_tracking_memory>::alloc(size_t size, size_t alignment) { | 308 | 712 | memory_check(size); | 309 | | // consume memory in tracker before alloc, similar to early declaration. | 310 | 712 | consume_memory(size); | 311 | 712 | void* buf; | 312 | 712 | size_t record_size = size; | 313 | | | 314 | 712 | if (use_mmap && size >= doris::config::mmap_threshold) { | 315 | 0 | if (alignment > MMAP_MIN_ALIGNMENT) { | 316 | 0 | throw doris::Exception( | 317 | 0 | doris::ErrorCode::INVALID_ARGUMENT, | 318 | 0 | "Too large alignment {}: more than page size when allocating {}.", alignment, | 319 | 0 | size); | 320 | 0 | } | 321 | | | 322 | 0 | buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); | 323 | 0 | if (MAP_FAILED == buf) { | 324 | 0 | release_memory(size); | 325 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mmap {}.", size)); | 326 | 0 | } | 327 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 328 | | record_size = MemoryAllocator::allocated_size(buf); | 329 | | } | 330 | | | 331 | | /// No need for zero-fill, because mmap guarantees it. | 332 | 712 | } else { | 333 | 712 | if (alignment <= MALLOC_MIN_ALIGNMENT) { | 334 | 712 | if constexpr (clear_memory) { | 335 | 712 | buf = MemoryAllocator::calloc(size, 1); | 336 | | } else { | 337 | | buf = MemoryAllocator::malloc(size); | 338 | | } | 339 | | | 340 | 712 | if (nullptr == buf) { | 341 | 0 | release_memory(size); | 342 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size)); | 343 | 0 | } | 344 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 345 | | record_size = MemoryAllocator::allocated_size(buf); | 346 | | } | 347 | 712 | add_address_sanitizers(buf, record_size); | 348 | 712 | } else { | 349 | 0 | buf = nullptr; | 350 | 0 | int res = MemoryAllocator::posix_memalign(&buf, alignment, size); | 351 | |
| 352 | 0 | if (0 != res) { | 353 | 0 | release_memory(size); | 354 | 0 | throw_bad_alloc(fmt::format("Cannot allocate memory (posix_memalign) {}.", size)); | 355 | 0 | } | 356 | |
| 357 | 0 | if constexpr (clear_memory) { | 358 | 0 | memset(buf, 0, size); | 359 | 0 | } | 360 | |
| 361 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 362 | | record_size = MemoryAllocator::allocated_size(buf); | 363 | | } | 364 | 0 | add_address_sanitizers(buf, record_size); | 365 | 0 | } | 366 | 712 | } | 367 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 368 | | consume_memory(record_size - size); | 369 | | } | 370 | 712 | return buf; | 371 | 712 | } |
_ZN5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE5allocEmm Line | Count | Source | 307 | 2 | check_and_tracking_memory>::alloc(size_t size, size_t alignment) { | 308 | 2 | memory_check(size); | 309 | | // consume memory in tracker before alloc, similar to early declaration. | 310 | 2 | consume_memory(size); | 311 | 2 | void* buf; | 312 | 2 | size_t record_size = size; | 313 | | | 314 | 2 | if (use_mmap && size >= doris::config::mmap_threshold) { | 315 | 0 | if (alignment > MMAP_MIN_ALIGNMENT) { | 316 | 0 | throw doris::Exception( | 317 | 0 | doris::ErrorCode::INVALID_ARGUMENT, | 318 | 0 | "Too large alignment {}: more than page size when allocating {}.", alignment, | 319 | 0 | size); | 320 | 0 | } | 321 | | | 322 | 0 | buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); | 323 | 0 | if (MAP_FAILED == buf) { | 324 | 0 | release_memory(size); | 325 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mmap {}.", size)); | 326 | 0 | } | 327 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 328 | | record_size = MemoryAllocator::allocated_size(buf); | 329 | | } | 330 | | | 331 | | /// No need for zero-fill, because mmap guarantees it. | 332 | 2 | } else { | 333 | 2 | if (alignment <= MALLOC_MIN_ALIGNMENT) { | 334 | 2 | if constexpr (clear_memory) { | 335 | 2 | buf = MemoryAllocator::calloc(size, 1); | 336 | | } else { | 337 | | buf = MemoryAllocator::malloc(size); | 338 | | } | 339 | | | 340 | 2 | if (nullptr == buf) { | 341 | 0 | release_memory(size); | 342 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size)); | 343 | 0 | } | 344 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 345 | | record_size = MemoryAllocator::allocated_size(buf); | 346 | | } | 347 | 2 | add_address_sanitizers(buf, record_size); | 348 | 2 | } else { | 349 | 0 | buf = nullptr; | 350 | 0 | int res = MemoryAllocator::posix_memalign(&buf, alignment, size); | 351 | |
| 352 | 0 | if (0 != res) { | 353 | 0 | release_memory(size); | 354 | 0 | throw_bad_alloc(fmt::format("Cannot allocate memory (posix_memalign) {}.", size)); | 355 | 0 | } | 356 | |
| 357 | 0 | if constexpr (clear_memory) { | 358 | 0 | memset(buf, 0, size); | 359 | 0 | } | 360 | |
| 361 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 362 | | record_size = MemoryAllocator::allocated_size(buf); | 363 | | } | 364 | 0 | add_address_sanitizers(buf, record_size); | 365 | 0 | } | 366 | 2 | } | 367 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 368 | | consume_memory(record_size - size); | 369 | | } | 370 | 2 | return buf; | 371 | 2 | } |
_ZN5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE5allocEmm Line | Count | Source | 307 | 22.2k | check_and_tracking_memory>::alloc(size_t size, size_t alignment) { | 308 | 22.2k | memory_check(size); | 309 | | // consume memory in tracker before alloc, similar to early declaration. | 310 | 22.2k | consume_memory(size); | 311 | 22.2k | void* buf; | 312 | 22.2k | size_t record_size = size; | 313 | | | 314 | 22.2k | if (use_mmap && size >= doris::config::mmap_threshold) { | 315 | 0 | if (alignment > MMAP_MIN_ALIGNMENT) { | 316 | 0 | throw doris::Exception( | 317 | 0 | doris::ErrorCode::INVALID_ARGUMENT, | 318 | 0 | "Too large alignment {}: more than page size when allocating {}.", alignment, | 319 | 0 | size); | 320 | 0 | } | 321 | | | 322 | 0 | buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); | 323 | 0 | if (MAP_FAILED == buf) { | 324 | 0 | release_memory(size); | 325 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mmap {}.", size)); | 326 | 0 | } | 327 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 328 | | record_size = MemoryAllocator::allocated_size(buf); | 329 | | } | 330 | | | 331 | | /// No need for zero-fill, because mmap guarantees it. | 332 | 22.2k | } else { | 333 | 22.2k | if (alignment <= MALLOC_MIN_ALIGNMENT) { | 334 | 22.2k | if constexpr (clear_memory) { | 335 | 22.2k | buf = MemoryAllocator::calloc(size, 1); | 336 | | } else { | 337 | | buf = MemoryAllocator::malloc(size); | 338 | | } | 339 | | | 340 | 22.2k | if (nullptr == buf) { | 341 | 0 | release_memory(size); | 342 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size)); | 343 | 0 | } | 344 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 345 | | record_size = MemoryAllocator::allocated_size(buf); | 346 | | } | 347 | 22.2k | add_address_sanitizers(buf, record_size); | 348 | 22.2k | } else { | 349 | 0 | buf = nullptr; | 350 | 0 | int res = MemoryAllocator::posix_memalign(&buf, alignment, size); | 351 | |
| 352 | 0 | if (0 != res) { | 353 | 0 | release_memory(size); | 354 | 0 | throw_bad_alloc(fmt::format("Cannot allocate memory (posix_memalign) {}.", size)); | 355 | 0 | } | 356 | |
| 357 | 0 | if constexpr (clear_memory) { | 358 | 0 | memset(buf, 0, size); | 359 | 0 | } | 360 | |
| 361 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 362 | | record_size = MemoryAllocator::allocated_size(buf); | 363 | | } | 364 | 0 | add_address_sanitizers(buf, record_size); | 365 | 0 | } | 366 | 22.2k | } | 367 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 368 | | consume_memory(record_size - size); | 369 | | } | 370 | 22.2k | return buf; | 371 | 22.2k | } |
_ZN5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE5allocEmm Line | Count | Source | 307 | 2 | check_and_tracking_memory>::alloc(size_t size, size_t alignment) { | 308 | 2 | memory_check(size); | 309 | | // consume memory in tracker before alloc, similar to early declaration. | 310 | 2 | consume_memory(size); | 311 | 2 | void* buf; | 312 | 2 | size_t record_size = size; | 313 | | | 314 | 2 | if (use_mmap && size >= doris::config::mmap_threshold) { | 315 | 0 | if (alignment > MMAP_MIN_ALIGNMENT) { | 316 | 0 | throw doris::Exception( | 317 | 0 | doris::ErrorCode::INVALID_ARGUMENT, | 318 | 0 | "Too large alignment {}: more than page size when allocating {}.", alignment, | 319 | 0 | size); | 320 | 0 | } | 321 | | | 322 | 0 | buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); | 323 | 0 | if (MAP_FAILED == buf) { | 324 | 0 | release_memory(size); | 325 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mmap {}.", size)); | 326 | 0 | } | 327 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 328 | | record_size = MemoryAllocator::allocated_size(buf); | 329 | | } | 330 | | | 331 | | /// No need for zero-fill, because mmap guarantees it. | 332 | 2 | } else { | 333 | 2 | if (alignment <= MALLOC_MIN_ALIGNMENT) { | 334 | | if constexpr (clear_memory) { | 335 | | buf = MemoryAllocator::calloc(size, 1); | 336 | 2 | } else { | 337 | 2 | buf = MemoryAllocator::malloc(size); | 338 | 2 | } | 339 | | | 340 | 2 | if (nullptr == buf) { | 341 | 0 | release_memory(size); | 342 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size)); | 343 | 0 | } | 344 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 345 | | record_size = MemoryAllocator::allocated_size(buf); | 346 | | } | 347 | 2 | add_address_sanitizers(buf, record_size); | 348 | 2 | } else { | 349 | 0 | buf = nullptr; | 350 | 0 | int res = MemoryAllocator::posix_memalign(&buf, alignment, size); | 351 | |
| 352 | 0 | if (0 != res) { | 353 | 0 | release_memory(size); | 354 | 0 | throw_bad_alloc(fmt::format("Cannot allocate memory (posix_memalign) {}.", size)); | 355 | 0 | } | 356 | |
| 357 | | if constexpr (clear_memory) { | 358 | | memset(buf, 0, size); | 359 | | } | 360 | |
| 361 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 362 | | record_size = MemoryAllocator::allocated_size(buf); | 363 | | } | 364 | 0 | add_address_sanitizers(buf, record_size); | 365 | 0 | } | 366 | 2 | } | 367 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 368 | | consume_memory(record_size - size); | 369 | | } | 370 | 2 | return buf; | 371 | 2 | } |
_ZN5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE5allocEmm Line | Count | Source | 307 | 2 | check_and_tracking_memory>::alloc(size_t size, size_t alignment) { | 308 | 2 | memory_check(size); | 309 | | // consume memory in tracker before alloc, similar to early declaration. | 310 | 2 | consume_memory(size); | 311 | 2 | void* buf; | 312 | 2 | size_t record_size = size; | 313 | | | 314 | 2 | if (use_mmap && size >= doris::config::mmap_threshold) { | 315 | 0 | if (alignment > MMAP_MIN_ALIGNMENT) { | 316 | 0 | throw doris::Exception( | 317 | 0 | doris::ErrorCode::INVALID_ARGUMENT, | 318 | 0 | "Too large alignment {}: more than page size when allocating {}.", alignment, | 319 | 0 | size); | 320 | 0 | } | 321 | | | 322 | 0 | buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); | 323 | 0 | if (MAP_FAILED == buf) { | 324 | 0 | release_memory(size); | 325 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mmap {}.", size)); | 326 | 0 | } | 327 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 328 | | record_size = MemoryAllocator::allocated_size(buf); | 329 | | } | 330 | | | 331 | | /// No need for zero-fill, because mmap guarantees it. | 332 | 2 | } else { | 333 | 2 | if (alignment <= MALLOC_MIN_ALIGNMENT) { | 334 | | if constexpr (clear_memory) { | 335 | | buf = MemoryAllocator::calloc(size, 1); | 336 | 2 | } else { | 337 | 2 | buf = MemoryAllocator::malloc(size); | 338 | 2 | } | 339 | | | 340 | 2 | if (nullptr == buf) { | 341 | 0 | release_memory(size); | 342 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size)); | 343 | 0 | } | 344 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 345 | | record_size = MemoryAllocator::allocated_size(buf); | 346 | | } | 347 | 2 | add_address_sanitizers(buf, record_size); | 348 | 2 | } else { | 349 | 0 | buf = nullptr; | 350 | 0 | int res = MemoryAllocator::posix_memalign(&buf, alignment, size); | 351 | |
| 352 | 0 | if (0 != res) { | 353 | 0 | release_memory(size); | 354 | 0 | throw_bad_alloc(fmt::format("Cannot allocate memory (posix_memalign) {}.", size)); | 355 | 0 | } | 356 | |
| 357 | | if constexpr (clear_memory) { | 358 | | memset(buf, 0, size); | 359 | | } | 360 | |
| 361 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 362 | | record_size = MemoryAllocator::allocated_size(buf); | 363 | | } | 364 | 0 | add_address_sanitizers(buf, record_size); | 365 | 0 | } | 366 | 2 | } | 367 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 368 | | consume_memory(record_size - size); | 369 | | } | 370 | 2 | return buf; | 371 | 2 | } |
_ZN5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE5allocEmm Line | Count | Source | 307 | 2 | check_and_tracking_memory>::alloc(size_t size, size_t alignment) { | 308 | 2 | memory_check(size); | 309 | | // consume memory in tracker before alloc, similar to early declaration. | 310 | 2 | consume_memory(size); | 311 | 2 | void* buf; | 312 | 2 | size_t record_size = size; | 313 | | | 314 | 2 | if (use_mmap && size >= doris::config::mmap_threshold) { | 315 | 0 | if (alignment > MMAP_MIN_ALIGNMENT) { | 316 | 0 | throw doris::Exception( | 317 | 0 | doris::ErrorCode::INVALID_ARGUMENT, | 318 | 0 | "Too large alignment {}: more than page size when allocating {}.", alignment, | 319 | 0 | size); | 320 | 0 | } | 321 | | | 322 | 0 | buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); | 323 | 0 | if (MAP_FAILED == buf) { | 324 | 0 | release_memory(size); | 325 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mmap {}.", size)); | 326 | 0 | } | 327 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 328 | | record_size = MemoryAllocator::allocated_size(buf); | 329 | | } | 330 | | | 331 | | /// No need for zero-fill, because mmap guarantees it. | 332 | 2 | } else { | 333 | 2 | if (alignment <= MALLOC_MIN_ALIGNMENT) { | 334 | | if constexpr (clear_memory) { | 335 | | buf = MemoryAllocator::calloc(size, 1); | 336 | 2 | } else { | 337 | 2 | buf = MemoryAllocator::malloc(size); | 338 | 2 | } | 339 | | | 340 | 2 | if (nullptr == buf) { | 341 | 0 | release_memory(size); | 342 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size)); | 343 | 0 | } | 344 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 345 | | record_size = MemoryAllocator::allocated_size(buf); | 346 | | } | 347 | 2 | add_address_sanitizers(buf, record_size); | 348 | 2 | } else { | 349 | 0 | buf = nullptr; | 350 | 0 | int res = MemoryAllocator::posix_memalign(&buf, alignment, size); | 351 | |
| 352 | 0 | if (0 != res) { | 353 | 0 | release_memory(size); | 354 | 0 | throw_bad_alloc(fmt::format("Cannot allocate memory (posix_memalign) {}.", size)); | 355 | 0 | } | 356 | |
| 357 | | if constexpr (clear_memory) { | 358 | | memset(buf, 0, size); | 359 | | } | 360 | |
| 361 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 362 | | record_size = MemoryAllocator::allocated_size(buf); | 363 | | } | 364 | 0 | add_address_sanitizers(buf, record_size); | 365 | 0 | } | 366 | 2 | } | 367 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 368 | | consume_memory(record_size - size); | 369 | | } | 370 | 2 | return buf; | 371 | 2 | } |
_ZN5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE5allocEmm Line | Count | Source | 307 | 687k | check_and_tracking_memory>::alloc(size_t size, size_t alignment) { | 308 | 687k | memory_check(size); | 309 | | // consume memory in tracker before alloc, similar to early declaration. | 310 | 687k | consume_memory(size); | 311 | 687k | void* buf; | 312 | 687k | size_t record_size = size; | 313 | | | 314 | 687k | if (use_mmap && size >= doris::config::mmap_threshold) { | 315 | 0 | if (alignment > MMAP_MIN_ALIGNMENT) { | 316 | 0 | throw doris::Exception( | 317 | 0 | doris::ErrorCode::INVALID_ARGUMENT, | 318 | 0 | "Too large alignment {}: more than page size when allocating {}.", alignment, | 319 | 0 | size); | 320 | 0 | } | 321 | | | 322 | 0 | buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); | 323 | 0 | if (MAP_FAILED == buf) { | 324 | 0 | release_memory(size); | 325 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mmap {}.", size)); | 326 | 0 | } | 327 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 328 | | record_size = MemoryAllocator::allocated_size(buf); | 329 | | } | 330 | | | 331 | | /// No need for zero-fill, because mmap guarantees it. | 332 | 687k | } else { | 333 | 687k | if (alignment <= MALLOC_MIN_ALIGNMENT) { | 334 | | if constexpr (clear_memory) { | 335 | | buf = MemoryAllocator::calloc(size, 1); | 336 | 638k | } else { | 337 | 638k | buf = MemoryAllocator::malloc(size); | 338 | 638k | } | 339 | | | 340 | 638k | if (nullptr == buf) { | 341 | 0 | release_memory(size); | 342 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size)); | 343 | 0 | } | 344 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 345 | | record_size = MemoryAllocator::allocated_size(buf); | 346 | | } | 347 | 638k | add_address_sanitizers(buf, record_size); | 348 | 638k | } else { | 349 | 49.3k | buf = nullptr; | 350 | 49.3k | int res = MemoryAllocator::posix_memalign(&buf, alignment, size); | 351 | | | 352 | 49.3k | if (0 != res) { | 353 | 0 | release_memory(size); | 354 | 0 | throw_bad_alloc(fmt::format("Cannot allocate memory (posix_memalign) {}.", size)); | 355 | 0 | } | 356 | | | 357 | | if constexpr (clear_memory) { | 358 | | memset(buf, 0, size); | 359 | | } | 360 | | | 361 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 362 | | record_size = MemoryAllocator::allocated_size(buf); | 363 | | } | 364 | 49.3k | add_address_sanitizers(buf, record_size); | 365 | 49.3k | } | 366 | 687k | } | 367 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 368 | | consume_memory(record_size - size); | 369 | | } | 370 | 687k | return buf; | 371 | 687k | } |
Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE5allocEmm _ZN5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE5allocEmm Line | Count | Source | 307 | 2.06M | check_and_tracking_memory>::alloc(size_t size, size_t alignment) { | 308 | 2.06M | memory_check(size); | 309 | | // consume memory in tracker before alloc, similar to early declaration. | 310 | 2.06M | consume_memory(size); | 311 | 2.06M | void* buf; | 312 | 2.06M | size_t record_size = size; | 313 | | | 314 | 2.06M | if (use_mmap && size >= doris::config::mmap_threshold) { | 315 | 0 | if (alignment > MMAP_MIN_ALIGNMENT) { | 316 | 0 | throw doris::Exception( | 317 | 0 | doris::ErrorCode::INVALID_ARGUMENT, | 318 | 0 | "Too large alignment {}: more than page size when allocating {}.", alignment, | 319 | 0 | size); | 320 | 0 | } | 321 | | | 322 | 0 | buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); | 323 | 0 | if (MAP_FAILED == buf) { | 324 | 0 | release_memory(size); | 325 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mmap {}.", size)); | 326 | 0 | } | 327 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 328 | | record_size = MemoryAllocator::allocated_size(buf); | 329 | | } | 330 | | | 331 | | /// No need for zero-fill, because mmap guarantees it. | 332 | 2.06M | } else { | 333 | 2.06M | if (alignment <= MALLOC_MIN_ALIGNMENT) { | 334 | | if constexpr (clear_memory) { | 335 | | buf = MemoryAllocator::calloc(size, 1); | 336 | 2.06M | } else { | 337 | 2.06M | buf = MemoryAllocator::malloc(size); | 338 | 2.06M | } | 339 | | | 340 | 2.06M | if (nullptr == buf) { | 341 | 0 | release_memory(size); | 342 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size)); | 343 | 0 | } | 344 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 345 | | record_size = MemoryAllocator::allocated_size(buf); | 346 | | } | 347 | 2.06M | add_address_sanitizers(buf, record_size); | 348 | 2.06M | } else { | 349 | 242 | buf = nullptr; | 350 | 242 | int res = MemoryAllocator::posix_memalign(&buf, alignment, size); | 351 | | | 352 | 242 | if (0 != res) { | 353 | 0 | release_memory(size); | 354 | 0 | throw_bad_alloc(fmt::format("Cannot allocate memory (posix_memalign) {}.", size)); | 355 | 0 | } | 356 | | | 357 | | if constexpr (clear_memory) { | 358 | | memset(buf, 0, size); | 359 | | } | 360 | | | 361 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 362 | | record_size = MemoryAllocator::allocated_size(buf); | 363 | | } | 364 | 242 | add_address_sanitizers(buf, record_size); | 365 | 242 | } | 366 | 2.06M | } | 367 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 368 | | consume_memory(record_size - size); | 369 | | } | 370 | 2.06M | return buf; | 371 | 2.06M | } |
Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE5allocEmm _ZN5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE5allocEmm Line | Count | Source | 307 | 3.48k | check_and_tracking_memory>::alloc(size_t size, size_t alignment) { | 308 | 3.48k | memory_check(size); | 309 | | // consume memory in tracker before alloc, similar to early declaration. | 310 | 3.48k | consume_memory(size); | 311 | 3.48k | void* buf; | 312 | 3.48k | size_t record_size = size; | 313 | | | 314 | 3.48k | if (use_mmap && size >= doris::config::mmap_threshold) { | 315 | 0 | if (alignment > MMAP_MIN_ALIGNMENT) { | 316 | 0 | throw doris::Exception( | 317 | 0 | doris::ErrorCode::INVALID_ARGUMENT, | 318 | 0 | "Too large alignment {}: more than page size when allocating {}.", alignment, | 319 | 0 | size); | 320 | 0 | } | 321 | | | 322 | 0 | buf = mmap(nullptr, size, PROT_READ | PROT_WRITE, mmap_flags, -1, 0); | 323 | 0 | if (MAP_FAILED == buf) { | 324 | 0 | release_memory(size); | 325 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mmap {}.", size)); | 326 | 0 | } | 327 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 328 | | record_size = MemoryAllocator::allocated_size(buf); | 329 | | } | 330 | | | 331 | | /// No need for zero-fill, because mmap guarantees it. | 332 | 3.48k | } else { | 333 | 3.48k | if (alignment <= MALLOC_MIN_ALIGNMENT) { | 334 | | if constexpr (clear_memory) { | 335 | | buf = MemoryAllocator::calloc(size, 1); | 336 | 3.48k | } else { | 337 | 3.48k | buf = MemoryAllocator::malloc(size); | 338 | 3.48k | } | 339 | | | 340 | 3.48k | if (nullptr == buf) { | 341 | 0 | release_memory(size); | 342 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size)); | 343 | 0 | } | 344 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 345 | | record_size = MemoryAllocator::allocated_size(buf); | 346 | | } | 347 | 3.48k | add_address_sanitizers(buf, record_size); | 348 | 3.48k | } else { | 349 | 0 | buf = nullptr; | 350 | 0 | int res = MemoryAllocator::posix_memalign(&buf, alignment, size); | 351 | |
| 352 | 0 | if (0 != res) { | 353 | 0 | release_memory(size); | 354 | 0 | throw_bad_alloc(fmt::format("Cannot allocate memory (posix_memalign) {}.", size)); | 355 | 0 | } | 356 | |
| 357 | | if constexpr (clear_memory) { | 358 | | memset(buf, 0, size); | 359 | | } | 360 | |
| 361 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 362 | | record_size = MemoryAllocator::allocated_size(buf); | 363 | | } | 364 | 0 | add_address_sanitizers(buf, record_size); | 365 | 0 | } | 366 | 3.48k | } | 367 | | if constexpr (MemoryAllocator::need_record_actual_size()) { | 368 | | consume_memory(record_size - size); | 369 | | } | 370 | 3.48k | return buf; | 371 | 3.48k | } |
Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE5allocEmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE5allocEmm |
372 | | |
373 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
374 | | bool check_and_tracking_memory> |
375 | | void Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
376 | 2.77M | check_and_tracking_memory>::free(void* buf, size_t size) const { |
377 | 2.77M | if (use_mmap && size >= doris::config::mmap_threshold) { |
378 | 0 | if (0 != munmap(buf, size)) { |
379 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot munmap {}.", size)); |
380 | 0 | } |
381 | 2.77M | } else { |
382 | 2.77M | remove_address_sanitizers(buf, size); |
383 | 2.77M | MemoryAllocator::free(buf); |
384 | 2.77M | } |
385 | 2.77M | release_memory(size); |
386 | 2.77M | } _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm Line | Count | Source | 376 | 2 | check_and_tracking_memory>::free(void* buf, size_t size) const { | 377 | 2 | if (use_mmap && size >= doris::config::mmap_threshold) { | 378 | 0 | if (0 != munmap(buf, size)) { | 379 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot munmap {}.", size)); | 380 | 0 | } | 381 | 2 | } else { | 382 | 2 | remove_address_sanitizers(buf, size); | 383 | 2 | MemoryAllocator::free(buf); | 384 | 2 | } | 385 | 2 | release_memory(size); | 386 | 2 | } |
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm Line | Count | Source | 376 | 712 | check_and_tracking_memory>::free(void* buf, size_t size) const { | 377 | 712 | if (use_mmap && size >= doris::config::mmap_threshold) { | 378 | 0 | if (0 != munmap(buf, size)) { | 379 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot munmap {}.", size)); | 380 | 0 | } | 381 | 712 | } else { | 382 | 712 | remove_address_sanitizers(buf, size); | 383 | 712 | MemoryAllocator::free(buf); | 384 | 712 | } | 385 | 712 | release_memory(size); | 386 | 712 | } |
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm Line | Count | Source | 376 | 2 | check_and_tracking_memory>::free(void* buf, size_t size) const { | 377 | 2 | if (use_mmap && size >= doris::config::mmap_threshold) { | 378 | 0 | if (0 != munmap(buf, size)) { | 379 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot munmap {}.", size)); | 380 | 0 | } | 381 | 2 | } else { | 382 | 2 | remove_address_sanitizers(buf, size); | 383 | 2 | MemoryAllocator::free(buf); | 384 | 2 | } | 385 | 2 | release_memory(size); | 386 | 2 | } |
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm Line | Count | Source | 376 | 22.2k | check_and_tracking_memory>::free(void* buf, size_t size) const { | 377 | 22.2k | if (use_mmap && size >= doris::config::mmap_threshold) { | 378 | 0 | if (0 != munmap(buf, size)) { | 379 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot munmap {}.", size)); | 380 | 0 | } | 381 | 22.2k | } else { | 382 | 22.2k | remove_address_sanitizers(buf, size); | 383 | 22.2k | MemoryAllocator::free(buf); | 384 | 22.2k | } | 385 | 22.2k | release_memory(size); | 386 | 22.2k | } |
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm Line | Count | Source | 376 | 2 | check_and_tracking_memory>::free(void* buf, size_t size) const { | 377 | 2 | if (use_mmap && size >= doris::config::mmap_threshold) { | 378 | 0 | if (0 != munmap(buf, size)) { | 379 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot munmap {}.", size)); | 380 | 0 | } | 381 | 2 | } else { | 382 | 2 | remove_address_sanitizers(buf, size); | 383 | 2 | MemoryAllocator::free(buf); | 384 | 2 | } | 385 | 2 | release_memory(size); | 386 | 2 | } |
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm Line | Count | Source | 376 | 2 | check_and_tracking_memory>::free(void* buf, size_t size) const { | 377 | 2 | if (use_mmap && size >= doris::config::mmap_threshold) { | 378 | 0 | if (0 != munmap(buf, size)) { | 379 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot munmap {}.", size)); | 380 | 0 | } | 381 | 2 | } else { | 382 | 2 | remove_address_sanitizers(buf, size); | 383 | 2 | MemoryAllocator::free(buf); | 384 | 2 | } | 385 | 2 | release_memory(size); | 386 | 2 | } |
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm Line | Count | Source | 376 | 2 | check_and_tracking_memory>::free(void* buf, size_t size) const { | 377 | 2 | if (use_mmap && size >= doris::config::mmap_threshold) { | 378 | 0 | if (0 != munmap(buf, size)) { | 379 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot munmap {}.", size)); | 380 | 0 | } | 381 | 2 | } else { | 382 | 2 | remove_address_sanitizers(buf, size); | 383 | 2 | MemoryAllocator::free(buf); | 384 | 2 | } | 385 | 2 | release_memory(size); | 386 | 2 | } |
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm Line | Count | Source | 376 | 682k | check_and_tracking_memory>::free(void* buf, size_t size) const { | 377 | 682k | if (use_mmap && size >= doris::config::mmap_threshold) { | 378 | 0 | if (0 != munmap(buf, size)) { | 379 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot munmap {}.", size)); | 380 | 0 | } | 381 | 682k | } else { | 382 | 682k | remove_address_sanitizers(buf, size); | 383 | 682k | MemoryAllocator::free(buf); | 384 | 682k | } | 385 | 682k | release_memory(size); | 386 | 682k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE4freeEPvm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE4freeEPvm Line | Count | Source | 376 | 2.06M | check_and_tracking_memory>::free(void* buf, size_t size) const { | 377 | 2.06M | if (use_mmap && size >= doris::config::mmap_threshold) { | 378 | 0 | if (0 != munmap(buf, size)) { | 379 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot munmap {}.", size)); | 380 | 0 | } | 381 | 2.06M | } else { | 382 | 2.06M | remove_address_sanitizers(buf, size); | 383 | 2.06M | MemoryAllocator::free(buf); | 384 | 2.06M | } | 385 | 2.06M | release_memory(size); | 386 | 2.06M | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE4freeEPvm _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE4freeEPvm Line | Count | Source | 376 | 3.48k | check_and_tracking_memory>::free(void* buf, size_t size) const { | 377 | 3.48k | if (use_mmap && size >= doris::config::mmap_threshold) { | 378 | 0 | if (0 != munmap(buf, size)) { | 379 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot munmap {}.", size)); | 380 | 0 | } | 381 | 3.48k | } else { | 382 | 3.48k | remove_address_sanitizers(buf, size); | 383 | 3.48k | MemoryAllocator::free(buf); | 384 | 3.48k | } | 385 | 3.48k | release_memory(size); | 386 | 3.48k | } |
Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE4freeEPvm Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE4freeEPvm |
387 | | |
388 | | template <bool clear_memory_, bool mmap_populate, bool use_mmap, typename MemoryAllocator, |
389 | | bool check_and_tracking_memory> |
390 | | void* Allocator<clear_memory_, mmap_populate, use_mmap, MemoryAllocator, |
391 | | check_and_tracking_memory>::realloc(void* buf, size_t old_size, size_t new_size, |
392 | 268k | size_t alignment) { |
393 | 268k | if (old_size == new_size) { |
394 | | /// nothing to do. |
395 | | /// BTW, it's not possible to change alignment while doing realloc. |
396 | 0 | return buf; |
397 | 0 | } |
398 | 268k | memory_check(new_size); |
399 | | // Realloc can do 2 possible things: |
400 | | // - expand existing memory region |
401 | | // - allocate new memory block and free the old one |
402 | | // Because we don't know which option will be picked we need to make sure there is enough |
403 | | // memory for all options. |
404 | 268k | consume_memory(new_size); |
405 | | |
406 | 268k | if (!use_mmap || |
407 | 268k | (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold && |
408 | 268k | alignment <= MALLOC_MIN_ALIGNMENT)) { |
409 | 268k | remove_address_sanitizers(buf, old_size); |
410 | | /// Resize malloc'd memory region with no special alignment requirement. |
411 | 268k | void* new_buf = MemoryAllocator::realloc(buf, new_size); |
412 | 268k | if (nullptr == new_buf) { |
413 | 0 | release_memory(new_size); |
414 | 0 | throw_bad_alloc( |
415 | 0 | fmt::format("Allocator: Cannot realloc from {} to {}.", old_size, new_size)); |
416 | 0 | } |
417 | | // usually, buf addr = new_buf addr, asan maybe not equal. |
418 | 268k | add_address_sanitizers(new_buf, new_size); |
419 | | |
420 | 268k | buf = new_buf; |
421 | 268k | release_memory(old_size); |
422 | 268k | if constexpr (clear_memory) { |
423 | 138 | if (new_size > old_size) { |
424 | 138 | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); |
425 | 138 | } |
426 | 138 | } |
427 | 268k | } else if (old_size >= doris::config::mmap_threshold && |
428 | 2 | new_size >= doris::config::mmap_threshold) { |
429 | | /// Resize mmap'd memory region. |
430 | | // On apple and freebsd self-implemented mremap used (common/mremap.h) |
431 | 0 | buf = clickhouse_mremap(buf, old_size, new_size, MREMAP_MAYMOVE, PROT_READ | PROT_WRITE, |
432 | 0 | mmap_flags, -1, 0); |
433 | 0 | if (MAP_FAILED == buf) { |
434 | 0 | release_memory(new_size); |
435 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mremap memory chunk from {} to {}.", |
436 | 0 | old_size, new_size)); |
437 | 0 | } |
438 | 0 | release_memory(old_size); |
439 | | |
440 | | /// No need for zero-fill, because mmap guarantees it. |
441 | |
|
442 | 0 | if constexpr (mmap_populate) { |
443 | | // MAP_POPULATE seems have no effect for mremap as for mmap, |
444 | | // Clear enlarged memory range explicitly to pre-fault the pages |
445 | 0 | if (new_size > old_size) { |
446 | 0 | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); |
447 | 0 | } |
448 | 0 | } |
449 | 2 | } else { |
450 | | // Big allocs that requires a copy. |
451 | 2 | void* new_buf = alloc(new_size, alignment); |
452 | 2 | memcpy(new_buf, buf, std::min(old_size, new_size)); |
453 | 2 | add_address_sanitizers(new_buf, new_size); |
454 | 2 | remove_address_sanitizers(buf, old_size); |
455 | 2 | free(buf, old_size); |
456 | 2 | buf = new_buf; |
457 | 2 | release_memory(old_size); |
458 | 2 | } |
459 | | |
460 | 268k | return buf; |
461 | 268k | } _ZN5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm Line | Count | Source | 392 | 2 | size_t alignment) { | 393 | 2 | if (old_size == new_size) { | 394 | | /// nothing to do. | 395 | | /// BTW, it's not possible to change alignment while doing realloc. | 396 | 0 | return buf; | 397 | 0 | } | 398 | 2 | memory_check(new_size); | 399 | | // Realloc can do 2 possible things: | 400 | | // - expand existing memory region | 401 | | // - allocate new memory block and free the old one | 402 | | // Because we don't know which option will be picked we need to make sure there is enough | 403 | | // memory for all options. | 404 | 2 | consume_memory(new_size); | 405 | | | 406 | 2 | if (!use_mmap || | 407 | 2 | (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold && | 408 | 2 | alignment <= MALLOC_MIN_ALIGNMENT)) { | 409 | 2 | remove_address_sanitizers(buf, old_size); | 410 | | /// Resize malloc'd memory region with no special alignment requirement. | 411 | 2 | void* new_buf = MemoryAllocator::realloc(buf, new_size); | 412 | 2 | if (nullptr == new_buf) { | 413 | 0 | release_memory(new_size); | 414 | 0 | throw_bad_alloc( | 415 | 0 | fmt::format("Allocator: Cannot realloc from {} to {}.", old_size, new_size)); | 416 | 0 | } | 417 | | // usually, buf addr = new_buf addr, asan maybe not equal. | 418 | 2 | add_address_sanitizers(new_buf, new_size); | 419 | | | 420 | 2 | buf = new_buf; | 421 | 2 | release_memory(old_size); | 422 | 2 | if constexpr (clear_memory) { | 423 | 2 | if (new_size > old_size) { | 424 | 2 | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 425 | 2 | } | 426 | 2 | } | 427 | 2 | } else if (old_size >= doris::config::mmap_threshold && | 428 | 0 | new_size >= doris::config::mmap_threshold) { | 429 | | /// Resize mmap'd memory region. | 430 | | // On apple and freebsd self-implemented mremap used (common/mremap.h) | 431 | 0 | buf = clickhouse_mremap(buf, old_size, new_size, MREMAP_MAYMOVE, PROT_READ | PROT_WRITE, | 432 | 0 | mmap_flags, -1, 0); | 433 | 0 | if (MAP_FAILED == buf) { | 434 | 0 | release_memory(new_size); | 435 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mremap memory chunk from {} to {}.", | 436 | 0 | old_size, new_size)); | 437 | 0 | } | 438 | 0 | release_memory(old_size); | 439 | | | 440 | | /// No need for zero-fill, because mmap guarantees it. | 441 | |
| 442 | 0 | if constexpr (mmap_populate) { | 443 | | // MAP_POPULATE seems have no effect for mremap as for mmap, | 444 | | // Clear enlarged memory range explicitly to pre-fault the pages | 445 | 0 | if (new_size > old_size) { | 446 | 0 | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 447 | 0 | } | 448 | 0 | } | 449 | 0 | } else { | 450 | | // Big allocs that requires a copy. | 451 | 0 | void* new_buf = alloc(new_size, alignment); | 452 | 0 | memcpy(new_buf, buf, std::min(old_size, new_size)); | 453 | 0 | add_address_sanitizers(new_buf, new_size); | 454 | 0 | remove_address_sanitizers(buf, old_size); | 455 | 0 | free(buf, old_size); | 456 | 0 | buf = new_buf; | 457 | 0 | release_memory(old_size); | 458 | 0 | } | 459 | | | 460 | 2 | return buf; | 461 | 2 | } |
_ZN5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm Line | Count | Source | 392 | 132 | size_t alignment) { | 393 | 132 | if (old_size == new_size) { | 394 | | /// nothing to do. | 395 | | /// BTW, it's not possible to change alignment while doing realloc. | 396 | 0 | return buf; | 397 | 0 | } | 398 | 132 | memory_check(new_size); | 399 | | // Realloc can do 2 possible things: | 400 | | // - expand existing memory region | 401 | | // - allocate new memory block and free the old one | 402 | | // Because we don't know which option will be picked we need to make sure there is enough | 403 | | // memory for all options. | 404 | 132 | consume_memory(new_size); | 405 | | | 406 | 132 | if (!use_mmap || | 407 | 132 | (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold && | 408 | 132 | alignment <= MALLOC_MIN_ALIGNMENT)) { | 409 | 132 | remove_address_sanitizers(buf, old_size); | 410 | | /// Resize malloc'd memory region with no special alignment requirement. | 411 | 132 | void* new_buf = MemoryAllocator::realloc(buf, new_size); | 412 | 132 | if (nullptr == new_buf) { | 413 | 0 | release_memory(new_size); | 414 | 0 | throw_bad_alloc( | 415 | 0 | fmt::format("Allocator: Cannot realloc from {} to {}.", old_size, new_size)); | 416 | 0 | } | 417 | | // usually, buf addr = new_buf addr, asan maybe not equal. | 418 | 132 | add_address_sanitizers(new_buf, new_size); | 419 | | | 420 | 132 | buf = new_buf; | 421 | 132 | release_memory(old_size); | 422 | 132 | if constexpr (clear_memory) { | 423 | 132 | if (new_size > old_size) { | 424 | 132 | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 425 | 132 | } | 426 | 132 | } | 427 | 132 | } else if (old_size >= doris::config::mmap_threshold && | 428 | 0 | new_size >= doris::config::mmap_threshold) { | 429 | | /// Resize mmap'd memory region. | 430 | | // On apple and freebsd self-implemented mremap used (common/mremap.h) | 431 | 0 | buf = clickhouse_mremap(buf, old_size, new_size, MREMAP_MAYMOVE, PROT_READ | PROT_WRITE, | 432 | 0 | mmap_flags, -1, 0); | 433 | 0 | if (MAP_FAILED == buf) { | 434 | 0 | release_memory(new_size); | 435 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mremap memory chunk from {} to {}.", | 436 | 0 | old_size, new_size)); | 437 | 0 | } | 438 | 0 | release_memory(old_size); | 439 | | | 440 | | /// No need for zero-fill, because mmap guarantees it. | 441 | |
| 442 | 0 | if constexpr (mmap_populate) { | 443 | | // MAP_POPULATE seems have no effect for mremap as for mmap, | 444 | | // Clear enlarged memory range explicitly to pre-fault the pages | 445 | 0 | if (new_size > old_size) { | 446 | 0 | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 447 | 0 | } | 448 | 0 | } | 449 | 0 | } else { | 450 | | // Big allocs that requires a copy. | 451 | 0 | void* new_buf = alloc(new_size, alignment); | 452 | 0 | memcpy(new_buf, buf, std::min(old_size, new_size)); | 453 | 0 | add_address_sanitizers(new_buf, new_size); | 454 | 0 | remove_address_sanitizers(buf, old_size); | 455 | 0 | free(buf, old_size); | 456 | 0 | buf = new_buf; | 457 | 0 | release_memory(old_size); | 458 | 0 | } | 459 | | | 460 | 132 | return buf; | 461 | 132 | } |
_ZN5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm Line | Count | Source | 392 | 2 | size_t alignment) { | 393 | 2 | if (old_size == new_size) { | 394 | | /// nothing to do. | 395 | | /// BTW, it's not possible to change alignment while doing realloc. | 396 | 0 | return buf; | 397 | 0 | } | 398 | 2 | memory_check(new_size); | 399 | | // Realloc can do 2 possible things: | 400 | | // - expand existing memory region | 401 | | // - allocate new memory block and free the old one | 402 | | // Because we don't know which option will be picked we need to make sure there is enough | 403 | | // memory for all options. | 404 | 2 | consume_memory(new_size); | 405 | | | 406 | 2 | if (!use_mmap || | 407 | 2 | (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold && | 408 | 2 | alignment <= MALLOC_MIN_ALIGNMENT)) { | 409 | 2 | remove_address_sanitizers(buf, old_size); | 410 | | /// Resize malloc'd memory region with no special alignment requirement. | 411 | 2 | void* new_buf = MemoryAllocator::realloc(buf, new_size); | 412 | 2 | if (nullptr == new_buf) { | 413 | 0 | release_memory(new_size); | 414 | 0 | throw_bad_alloc( | 415 | 0 | fmt::format("Allocator: Cannot realloc from {} to {}.", old_size, new_size)); | 416 | 0 | } | 417 | | // usually, buf addr = new_buf addr, asan maybe not equal. | 418 | 2 | add_address_sanitizers(new_buf, new_size); | 419 | | | 420 | 2 | buf = new_buf; | 421 | 2 | release_memory(old_size); | 422 | 2 | if constexpr (clear_memory) { | 423 | 2 | if (new_size > old_size) { | 424 | 2 | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 425 | 2 | } | 426 | 2 | } | 427 | 2 | } else if (old_size >= doris::config::mmap_threshold && | 428 | 0 | new_size >= doris::config::mmap_threshold) { | 429 | | /// Resize mmap'd memory region. | 430 | | // On apple and freebsd self-implemented mremap used (common/mremap.h) | 431 | 0 | buf = clickhouse_mremap(buf, old_size, new_size, MREMAP_MAYMOVE, PROT_READ | PROT_WRITE, | 432 | 0 | mmap_flags, -1, 0); | 433 | 0 | if (MAP_FAILED == buf) { | 434 | 0 | release_memory(new_size); | 435 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mremap memory chunk from {} to {}.", | 436 | 0 | old_size, new_size)); | 437 | 0 | } | 438 | 0 | release_memory(old_size); | 439 | | | 440 | | /// No need for zero-fill, because mmap guarantees it. | 441 | |
| 442 | | if constexpr (mmap_populate) { | 443 | | // MAP_POPULATE seems have no effect for mremap as for mmap, | 444 | | // Clear enlarged memory range explicitly to pre-fault the pages | 445 | | if (new_size > old_size) { | 446 | | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 447 | | } | 448 | | } | 449 | 0 | } else { | 450 | | // Big allocs that requires a copy. | 451 | 0 | void* new_buf = alloc(new_size, alignment); | 452 | 0 | memcpy(new_buf, buf, std::min(old_size, new_size)); | 453 | 0 | add_address_sanitizers(new_buf, new_size); | 454 | 0 | remove_address_sanitizers(buf, old_size); | 455 | 0 | free(buf, old_size); | 456 | 0 | buf = new_buf; | 457 | 0 | release_memory(old_size); | 458 | 0 | } | 459 | | | 460 | 2 | return buf; | 461 | 2 | } |
_ZN5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm Line | Count | Source | 392 | 2 | size_t alignment) { | 393 | 2 | if (old_size == new_size) { | 394 | | /// nothing to do. | 395 | | /// BTW, it's not possible to change alignment while doing realloc. | 396 | 0 | return buf; | 397 | 0 | } | 398 | 2 | memory_check(new_size); | 399 | | // Realloc can do 2 possible things: | 400 | | // - expand existing memory region | 401 | | // - allocate new memory block and free the old one | 402 | | // Because we don't know which option will be picked we need to make sure there is enough | 403 | | // memory for all options. | 404 | 2 | consume_memory(new_size); | 405 | | | 406 | 2 | if (!use_mmap || | 407 | 2 | (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold && | 408 | 2 | alignment <= MALLOC_MIN_ALIGNMENT)) { | 409 | 2 | remove_address_sanitizers(buf, old_size); | 410 | | /// Resize malloc'd memory region with no special alignment requirement. | 411 | 2 | void* new_buf = MemoryAllocator::realloc(buf, new_size); | 412 | 2 | if (nullptr == new_buf) { | 413 | 0 | release_memory(new_size); | 414 | 0 | throw_bad_alloc( | 415 | 0 | fmt::format("Allocator: Cannot realloc from {} to {}.", old_size, new_size)); | 416 | 0 | } | 417 | | // usually, buf addr = new_buf addr, asan maybe not equal. | 418 | 2 | add_address_sanitizers(new_buf, new_size); | 419 | | | 420 | 2 | buf = new_buf; | 421 | 2 | release_memory(old_size); | 422 | 2 | if constexpr (clear_memory) { | 423 | 2 | if (new_size > old_size) { | 424 | 2 | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 425 | 2 | } | 426 | 2 | } | 427 | 2 | } else if (old_size >= doris::config::mmap_threshold && | 428 | 0 | new_size >= doris::config::mmap_threshold) { | 429 | | /// Resize mmap'd memory region. | 430 | | // On apple and freebsd self-implemented mremap used (common/mremap.h) | 431 | 0 | buf = clickhouse_mremap(buf, old_size, new_size, MREMAP_MAYMOVE, PROT_READ | PROT_WRITE, | 432 | 0 | mmap_flags, -1, 0); | 433 | 0 | if (MAP_FAILED == buf) { | 434 | 0 | release_memory(new_size); | 435 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mremap memory chunk from {} to {}.", | 436 | 0 | old_size, new_size)); | 437 | 0 | } | 438 | 0 | release_memory(old_size); | 439 | | | 440 | | /// No need for zero-fill, because mmap guarantees it. | 441 | |
| 442 | | if constexpr (mmap_populate) { | 443 | | // MAP_POPULATE seems have no effect for mremap as for mmap, | 444 | | // Clear enlarged memory range explicitly to pre-fault the pages | 445 | | if (new_size > old_size) { | 446 | | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 447 | | } | 448 | | } | 449 | 0 | } else { | 450 | | // Big allocs that requires a copy. | 451 | 0 | void* new_buf = alloc(new_size, alignment); | 452 | 0 | memcpy(new_buf, buf, std::min(old_size, new_size)); | 453 | 0 | add_address_sanitizers(new_buf, new_size); | 454 | 0 | remove_address_sanitizers(buf, old_size); | 455 | 0 | free(buf, old_size); | 456 | 0 | buf = new_buf; | 457 | 0 | release_memory(old_size); | 458 | 0 | } | 459 | | | 460 | 2 | return buf; | 461 | 2 | } |
_ZN5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm Line | Count | Source | 392 | 2 | size_t alignment) { | 393 | 2 | if (old_size == new_size) { | 394 | | /// nothing to do. | 395 | | /// BTW, it's not possible to change alignment while doing realloc. | 396 | 0 | return buf; | 397 | 0 | } | 398 | 2 | memory_check(new_size); | 399 | | // Realloc can do 2 possible things: | 400 | | // - expand existing memory region | 401 | | // - allocate new memory block and free the old one | 402 | | // Because we don't know which option will be picked we need to make sure there is enough | 403 | | // memory for all options. | 404 | 2 | consume_memory(new_size); | 405 | | | 406 | 2 | if (!use_mmap || | 407 | 2 | (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold && | 408 | 2 | alignment <= MALLOC_MIN_ALIGNMENT)) { | 409 | 2 | remove_address_sanitizers(buf, old_size); | 410 | | /// Resize malloc'd memory region with no special alignment requirement. | 411 | 2 | void* new_buf = MemoryAllocator::realloc(buf, new_size); | 412 | 2 | if (nullptr == new_buf) { | 413 | 0 | release_memory(new_size); | 414 | 0 | throw_bad_alloc( | 415 | 0 | fmt::format("Allocator: Cannot realloc from {} to {}.", old_size, new_size)); | 416 | 0 | } | 417 | | // usually, buf addr = new_buf addr, asan maybe not equal. | 418 | 2 | add_address_sanitizers(new_buf, new_size); | 419 | | | 420 | 2 | buf = new_buf; | 421 | 2 | release_memory(old_size); | 422 | | if constexpr (clear_memory) { | 423 | | if (new_size > old_size) { | 424 | | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 425 | | } | 426 | | } | 427 | 2 | } else if (old_size >= doris::config::mmap_threshold && | 428 | 0 | new_size >= doris::config::mmap_threshold) { | 429 | | /// Resize mmap'd memory region. | 430 | | // On apple and freebsd self-implemented mremap used (common/mremap.h) | 431 | 0 | buf = clickhouse_mremap(buf, old_size, new_size, MREMAP_MAYMOVE, PROT_READ | PROT_WRITE, | 432 | 0 | mmap_flags, -1, 0); | 433 | 0 | if (MAP_FAILED == buf) { | 434 | 0 | release_memory(new_size); | 435 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mremap memory chunk from {} to {}.", | 436 | 0 | old_size, new_size)); | 437 | 0 | } | 438 | 0 | release_memory(old_size); | 439 | | | 440 | | /// No need for zero-fill, because mmap guarantees it. | 441 | |
| 442 | 0 | if constexpr (mmap_populate) { | 443 | | // MAP_POPULATE seems have no effect for mremap as for mmap, | 444 | | // Clear enlarged memory range explicitly to pre-fault the pages | 445 | 0 | if (new_size > old_size) { | 446 | 0 | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 447 | 0 | } | 448 | 0 | } | 449 | 0 | } else { | 450 | | // Big allocs that requires a copy. | 451 | 0 | void* new_buf = alloc(new_size, alignment); | 452 | 0 | memcpy(new_buf, buf, std::min(old_size, new_size)); | 453 | 0 | add_address_sanitizers(new_buf, new_size); | 454 | 0 | remove_address_sanitizers(buf, old_size); | 455 | 0 | free(buf, old_size); | 456 | 0 | buf = new_buf; | 457 | 0 | release_memory(old_size); | 458 | 0 | } | 459 | | | 460 | 2 | return buf; | 461 | 2 | } |
_ZN5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm Line | Count | Source | 392 | 2 | size_t alignment) { | 393 | 2 | if (old_size == new_size) { | 394 | | /// nothing to do. | 395 | | /// BTW, it's not possible to change alignment while doing realloc. | 396 | 0 | return buf; | 397 | 0 | } | 398 | 2 | memory_check(new_size); | 399 | | // Realloc can do 2 possible things: | 400 | | // - expand existing memory region | 401 | | // - allocate new memory block and free the old one | 402 | | // Because we don't know which option will be picked we need to make sure there is enough | 403 | | // memory for all options. | 404 | 2 | consume_memory(new_size); | 405 | | | 406 | 2 | if (!use_mmap || | 407 | 2 | (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold && | 408 | 2 | alignment <= MALLOC_MIN_ALIGNMENT)) { | 409 | 2 | remove_address_sanitizers(buf, old_size); | 410 | | /// Resize malloc'd memory region with no special alignment requirement. | 411 | 2 | void* new_buf = MemoryAllocator::realloc(buf, new_size); | 412 | 2 | if (nullptr == new_buf) { | 413 | 0 | release_memory(new_size); | 414 | 0 | throw_bad_alloc( | 415 | 0 | fmt::format("Allocator: Cannot realloc from {} to {}.", old_size, new_size)); | 416 | 0 | } | 417 | | // usually, buf addr = new_buf addr, asan maybe not equal. | 418 | 2 | add_address_sanitizers(new_buf, new_size); | 419 | | | 420 | 2 | buf = new_buf; | 421 | 2 | release_memory(old_size); | 422 | | if constexpr (clear_memory) { | 423 | | if (new_size > old_size) { | 424 | | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 425 | | } | 426 | | } | 427 | 2 | } else if (old_size >= doris::config::mmap_threshold && | 428 | 0 | new_size >= doris::config::mmap_threshold) { | 429 | | /// Resize mmap'd memory region. | 430 | | // On apple and freebsd self-implemented mremap used (common/mremap.h) | 431 | 0 | buf = clickhouse_mremap(buf, old_size, new_size, MREMAP_MAYMOVE, PROT_READ | PROT_WRITE, | 432 | 0 | mmap_flags, -1, 0); | 433 | 0 | if (MAP_FAILED == buf) { | 434 | 0 | release_memory(new_size); | 435 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mremap memory chunk from {} to {}.", | 436 | 0 | old_size, new_size)); | 437 | 0 | } | 438 | 0 | release_memory(old_size); | 439 | | | 440 | | /// No need for zero-fill, because mmap guarantees it. | 441 | |
| 442 | 0 | if constexpr (mmap_populate) { | 443 | | // MAP_POPULATE seems have no effect for mremap as for mmap, | 444 | | // Clear enlarged memory range explicitly to pre-fault the pages | 445 | 0 | if (new_size > old_size) { | 446 | 0 | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 447 | 0 | } | 448 | 0 | } | 449 | 0 | } else { | 450 | | // Big allocs that requires a copy. | 451 | 0 | void* new_buf = alloc(new_size, alignment); | 452 | 0 | memcpy(new_buf, buf, std::min(old_size, new_size)); | 453 | 0 | add_address_sanitizers(new_buf, new_size); | 454 | 0 | remove_address_sanitizers(buf, old_size); | 455 | 0 | free(buf, old_size); | 456 | 0 | buf = new_buf; | 457 | 0 | release_memory(old_size); | 458 | 0 | } | 459 | | | 460 | 2 | return buf; | 461 | 2 | } |
_ZN5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm Line | Count | Source | 392 | 2 | size_t alignment) { | 393 | 2 | if (old_size == new_size) { | 394 | | /// nothing to do. | 395 | | /// BTW, it's not possible to change alignment while doing realloc. | 396 | 0 | return buf; | 397 | 0 | } | 398 | 2 | memory_check(new_size); | 399 | | // Realloc can do 2 possible things: | 400 | | // - expand existing memory region | 401 | | // - allocate new memory block and free the old one | 402 | | // Because we don't know which option will be picked we need to make sure there is enough | 403 | | // memory for all options. | 404 | 2 | consume_memory(new_size); | 405 | | | 406 | 2 | if (!use_mmap || | 407 | 2 | (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold && | 408 | 2 | alignment <= MALLOC_MIN_ALIGNMENT)) { | 409 | 2 | remove_address_sanitizers(buf, old_size); | 410 | | /// Resize malloc'd memory region with no special alignment requirement. | 411 | 2 | void* new_buf = MemoryAllocator::realloc(buf, new_size); | 412 | 2 | if (nullptr == new_buf) { | 413 | 0 | release_memory(new_size); | 414 | 0 | throw_bad_alloc( | 415 | 0 | fmt::format("Allocator: Cannot realloc from {} to {}.", old_size, new_size)); | 416 | 0 | } | 417 | | // usually, buf addr = new_buf addr, asan maybe not equal. | 418 | 2 | add_address_sanitizers(new_buf, new_size); | 419 | | | 420 | 2 | buf = new_buf; | 421 | 2 | release_memory(old_size); | 422 | | if constexpr (clear_memory) { | 423 | | if (new_size > old_size) { | 424 | | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 425 | | } | 426 | | } | 427 | 2 | } else if (old_size >= doris::config::mmap_threshold && | 428 | 0 | new_size >= doris::config::mmap_threshold) { | 429 | | /// Resize mmap'd memory region. | 430 | | // On apple and freebsd self-implemented mremap used (common/mremap.h) | 431 | 0 | buf = clickhouse_mremap(buf, old_size, new_size, MREMAP_MAYMOVE, PROT_READ | PROT_WRITE, | 432 | 0 | mmap_flags, -1, 0); | 433 | 0 | if (MAP_FAILED == buf) { | 434 | 0 | release_memory(new_size); | 435 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mremap memory chunk from {} to {}.", | 436 | 0 | old_size, new_size)); | 437 | 0 | } | 438 | 0 | release_memory(old_size); | 439 | | | 440 | | /// No need for zero-fill, because mmap guarantees it. | 441 | |
| 442 | | if constexpr (mmap_populate) { | 443 | | // MAP_POPULATE seems have no effect for mremap as for mmap, | 444 | | // Clear enlarged memory range explicitly to pre-fault the pages | 445 | | if (new_size > old_size) { | 446 | | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 447 | | } | 448 | | } | 449 | 0 | } else { | 450 | | // Big allocs that requires a copy. | 451 | 0 | void* new_buf = alloc(new_size, alignment); | 452 | 0 | memcpy(new_buf, buf, std::min(old_size, new_size)); | 453 | 0 | add_address_sanitizers(new_buf, new_size); | 454 | 0 | remove_address_sanitizers(buf, old_size); | 455 | 0 | free(buf, old_size); | 456 | 0 | buf = new_buf; | 457 | 0 | release_memory(old_size); | 458 | 0 | } | 459 | | | 460 | 2 | return buf; | 461 | 2 | } |
_ZN5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm Line | Count | Source | 392 | 2 | size_t alignment) { | 393 | 2 | if (old_size == new_size) { | 394 | | /// nothing to do. | 395 | | /// BTW, it's not possible to change alignment while doing realloc. | 396 | 0 | return buf; | 397 | 0 | } | 398 | 2 | memory_check(new_size); | 399 | | // Realloc can do 2 possible things: | 400 | | // - expand existing memory region | 401 | | // - allocate new memory block and free the old one | 402 | | // Because we don't know which option will be picked we need to make sure there is enough | 403 | | // memory for all options. | 404 | 2 | consume_memory(new_size); | 405 | | | 406 | 2 | if (!use_mmap || | 407 | 2 | (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold && | 408 | 2 | alignment <= MALLOC_MIN_ALIGNMENT)) { | 409 | 2 | remove_address_sanitizers(buf, old_size); | 410 | | /// Resize malloc'd memory region with no special alignment requirement. | 411 | 2 | void* new_buf = MemoryAllocator::realloc(buf, new_size); | 412 | 2 | if (nullptr == new_buf) { | 413 | 0 | release_memory(new_size); | 414 | 0 | throw_bad_alloc( | 415 | 0 | fmt::format("Allocator: Cannot realloc from {} to {}.", old_size, new_size)); | 416 | 0 | } | 417 | | // usually, buf addr = new_buf addr, asan maybe not equal. | 418 | 2 | add_address_sanitizers(new_buf, new_size); | 419 | | | 420 | 2 | buf = new_buf; | 421 | 2 | release_memory(old_size); | 422 | | if constexpr (clear_memory) { | 423 | | if (new_size > old_size) { | 424 | | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 425 | | } | 426 | | } | 427 | 2 | } else if (old_size >= doris::config::mmap_threshold && | 428 | 0 | new_size >= doris::config::mmap_threshold) { | 429 | | /// Resize mmap'd memory region. | 430 | | // On apple and freebsd self-implemented mremap used (common/mremap.h) | 431 | 0 | buf = clickhouse_mremap(buf, old_size, new_size, MREMAP_MAYMOVE, PROT_READ | PROT_WRITE, | 432 | 0 | mmap_flags, -1, 0); | 433 | 0 | if (MAP_FAILED == buf) { | 434 | 0 | release_memory(new_size); | 435 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mremap memory chunk from {} to {}.", | 436 | 0 | old_size, new_size)); | 437 | 0 | } | 438 | 0 | release_memory(old_size); | 439 | | | 440 | | /// No need for zero-fill, because mmap guarantees it. | 441 | |
| 442 | | if constexpr (mmap_populate) { | 443 | | // MAP_POPULATE seems have no effect for mremap as for mmap, | 444 | | // Clear enlarged memory range explicitly to pre-fault the pages | 445 | | if (new_size > old_size) { | 446 | | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 447 | | } | 448 | | } | 449 | 0 | } else { | 450 | | // Big allocs that requires a copy. | 451 | 0 | void* new_buf = alloc(new_size, alignment); | 452 | 0 | memcpy(new_buf, buf, std::min(old_size, new_size)); | 453 | 0 | add_address_sanitizers(new_buf, new_size); | 454 | 0 | remove_address_sanitizers(buf, old_size); | 455 | 0 | free(buf, old_size); | 456 | 0 | buf = new_buf; | 457 | 0 | release_memory(old_size); | 458 | 0 | } | 459 | | | 460 | 2 | return buf; | 461 | 2 | } |
Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb0EE7reallocEPvmmm _ZN5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE7reallocEPvmmm Line | Count | Source | 392 | 268k | size_t alignment) { | 393 | 268k | if (old_size == new_size) { | 394 | | /// nothing to do. | 395 | | /// BTW, it's not possible to change alignment while doing realloc. | 396 | 0 | return buf; | 397 | 0 | } | 398 | 268k | memory_check(new_size); | 399 | | // Realloc can do 2 possible things: | 400 | | // - expand existing memory region | 401 | | // - allocate new memory block and free the old one | 402 | | // Because we don't know which option will be picked we need to make sure there is enough | 403 | | // memory for all options. | 404 | 268k | consume_memory(new_size); | 405 | | | 406 | 268k | if (!use_mmap || | 407 | 268k | (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold && | 408 | 268k | alignment <= MALLOC_MIN_ALIGNMENT)) { | 409 | 268k | remove_address_sanitizers(buf, old_size); | 410 | | /// Resize malloc'd memory region with no special alignment requirement. | 411 | 268k | void* new_buf = MemoryAllocator::realloc(buf, new_size); | 412 | 268k | if (nullptr == new_buf) { | 413 | 0 | release_memory(new_size); | 414 | 0 | throw_bad_alloc( | 415 | 0 | fmt::format("Allocator: Cannot realloc from {} to {}.", old_size, new_size)); | 416 | 0 | } | 417 | | // usually, buf addr = new_buf addr, asan maybe not equal. | 418 | 268k | add_address_sanitizers(new_buf, new_size); | 419 | | | 420 | 268k | buf = new_buf; | 421 | 268k | release_memory(old_size); | 422 | | if constexpr (clear_memory) { | 423 | | if (new_size > old_size) { | 424 | | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 425 | | } | 426 | | } | 427 | 268k | } else if (old_size >= doris::config::mmap_threshold && | 428 | 2 | new_size >= doris::config::mmap_threshold) { | 429 | | /// Resize mmap'd memory region. | 430 | | // On apple and freebsd self-implemented mremap used (common/mremap.h) | 431 | 0 | buf = clickhouse_mremap(buf, old_size, new_size, MREMAP_MAYMOVE, PROT_READ | PROT_WRITE, | 432 | 0 | mmap_flags, -1, 0); | 433 | 0 | if (MAP_FAILED == buf) { | 434 | 0 | release_memory(new_size); | 435 | 0 | throw_bad_alloc(fmt::format("Allocator: Cannot mremap memory chunk from {} to {}.", | 436 | 0 | old_size, new_size)); | 437 | 0 | } | 438 | 0 | release_memory(old_size); | 439 | | | 440 | | /// No need for zero-fill, because mmap guarantees it. | 441 | |
| 442 | | if constexpr (mmap_populate) { | 443 | | // MAP_POPULATE seems have no effect for mremap as for mmap, | 444 | | // Clear enlarged memory range explicitly to pre-fault the pages | 445 | | if (new_size > old_size) { | 446 | | memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size); | 447 | | } | 448 | | } | 449 | 2 | } else { | 450 | | // Big allocs that requires a copy. | 451 | 2 | void* new_buf = alloc(new_size, alignment); | 452 | 2 | memcpy(new_buf, buf, std::min(old_size, new_size)); | 453 | 2 | add_address_sanitizers(new_buf, new_size); | 454 | 2 | remove_address_sanitizers(buf, old_size); | 455 | 2 | free(buf, old_size); | 456 | 2 | buf = new_buf; | 457 | 2 | release_memory(old_size); | 458 | 2 | } | 459 | | | 460 | 268k | return buf; | 461 | 268k | } |
Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb1ENS_18ORCMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb0ENS_18ORCMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb1ENS_18ORCMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb0ENS_18ORCMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb1EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb1ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb1ENS_25RecordSizeMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb1ELb0ENS_25RecordSizeMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb1ENS_25RecordSizeMemoryAllocatorELb0EE7reallocEPvmmm Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb0ENS_25RecordSizeMemoryAllocatorELb0EE7reallocEPvmmm |
462 | | |
463 | | template class Allocator<true, true, true, DefaultMemoryAllocator, true>; |
464 | | template class Allocator<true, true, false, DefaultMemoryAllocator, true>; |
465 | | template class Allocator<true, false, true, DefaultMemoryAllocator, true>; |
466 | | template class Allocator<true, false, false, DefaultMemoryAllocator, true>; |
467 | | template class Allocator<false, true, true, DefaultMemoryAllocator, true>; |
468 | | template class Allocator<false, true, false, DefaultMemoryAllocator, true>; |
469 | | template class Allocator<false, false, true, DefaultMemoryAllocator, true>; |
470 | | template class Allocator<false, false, false, DefaultMemoryAllocator, true>; |
471 | | template class Allocator<true, true, true, DefaultMemoryAllocator, false>; |
472 | | template class Allocator<true, true, false, DefaultMemoryAllocator, false>; |
473 | | template class Allocator<true, false, true, DefaultMemoryAllocator, false>; |
474 | | template class Allocator<true, false, false, DefaultMemoryAllocator, false>; |
475 | | template class Allocator<false, true, true, DefaultMemoryAllocator, false>; |
476 | | template class Allocator<false, true, false, DefaultMemoryAllocator, false>; |
477 | | template class Allocator<false, false, true, DefaultMemoryAllocator, false>; |
478 | | template class Allocator<false, false, false, DefaultMemoryAllocator, false>; |
479 | | |
480 | | /** It would be better to put these Memory Allocators where they are used, such as in the orc memory pool and arrow memory pool. |
481 | | * But currently allocators use templates in .cpp instead of all in .h, so they can only be placed here. |
482 | | */ |
483 | | template class Allocator<true, true, true, ORCMemoryAllocator, true>; |
484 | | template class Allocator<true, true, false, ORCMemoryAllocator, true>; |
485 | | template class Allocator<true, false, true, ORCMemoryAllocator, true>; |
486 | | template class Allocator<true, false, false, ORCMemoryAllocator, true>; |
487 | | template class Allocator<false, true, true, ORCMemoryAllocator, true>; |
488 | | template class Allocator<false, true, false, ORCMemoryAllocator, true>; |
489 | | template class Allocator<false, false, true, ORCMemoryAllocator, true>; |
490 | | template class Allocator<false, false, false, ORCMemoryAllocator, true>; |
491 | | template class Allocator<true, true, true, ORCMemoryAllocator, false>; |
492 | | template class Allocator<true, true, false, ORCMemoryAllocator, false>; |
493 | | template class Allocator<true, false, true, ORCMemoryAllocator, false>; |
494 | | template class Allocator<true, false, false, ORCMemoryAllocator, false>; |
495 | | template class Allocator<false, true, true, ORCMemoryAllocator, false>; |
496 | | template class Allocator<false, true, false, ORCMemoryAllocator, false>; |
497 | | template class Allocator<false, false, true, ORCMemoryAllocator, false>; |
498 | | template class Allocator<false, false, false, ORCMemoryAllocator, false>; |
499 | | |
500 | | template class Allocator<true, true, true, RecordSizeMemoryAllocator, true>; |
501 | | template class Allocator<true, true, false, RecordSizeMemoryAllocator, true>; |
502 | | template class Allocator<true, false, true, RecordSizeMemoryAllocator, true>; |
503 | | template class Allocator<true, false, false, RecordSizeMemoryAllocator, true>; |
504 | | template class Allocator<false, true, true, RecordSizeMemoryAllocator, true>; |
505 | | template class Allocator<false, true, false, RecordSizeMemoryAllocator, true>; |
506 | | template class Allocator<false, false, true, RecordSizeMemoryAllocator, true>; |
507 | | template class Allocator<false, false, false, RecordSizeMemoryAllocator, true>; |
508 | | template class Allocator<true, true, true, RecordSizeMemoryAllocator, false>; |
509 | | template class Allocator<true, true, false, RecordSizeMemoryAllocator, false>; |
510 | | template class Allocator<true, false, true, RecordSizeMemoryAllocator, false>; |
511 | | template class Allocator<true, false, false, RecordSizeMemoryAllocator, false>; |
512 | | template class Allocator<false, true, true, RecordSizeMemoryAllocator, false>; |
513 | | template class Allocator<false, true, false, RecordSizeMemoryAllocator, false>; |
514 | | template class Allocator<false, false, true, RecordSizeMemoryAllocator, false>; |
515 | | template class Allocator<false, false, false, RecordSizeMemoryAllocator, false>; |
516 | | |
517 | | } // namespace doris |