Coverage Report

Created: 2026-03-24 20:45

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
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
6.11M
                                                             std::string* err_msg) const {
53
6.11M
#ifdef BE_TEST
54
6.11M
    if (!doris::pthread_context_ptr_init) {
55
630k
        return false;
56
630k
    }
57
5.48M
#endif
58
5.48M
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
59
0
        return false;
60
0
    }
61
62
5.48M
    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
5.48M
    return false;
87
5.48M
}
_ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
52
8
                                                             std::string* err_msg) const {
53
8
#ifdef BE_TEST
54
8
    if (!doris::pthread_context_ptr_init) {
55
0
        return false;
56
0
    }
57
8
#endif
58
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
59
0
        return false;
60
0
    }
61
62
8
    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
8
    return false;
87
8
}
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
52
1.68k
                                                             std::string* err_msg) const {
53
1.68k
#ifdef BE_TEST
54
1.68k
    if (!doris::pthread_context_ptr_init) {
55
0
        return false;
56
0
    }
57
1.68k
#endif
58
1.68k
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
59
0
        return false;
60
0
    }
61
62
1.68k
    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
1.68k
    return false;
87
1.68k
}
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
52
8
                                                             std::string* err_msg) const {
53
8
#ifdef BE_TEST
54
8
    if (!doris::pthread_context_ptr_init) {
55
0
        return false;
56
0
    }
57
8
#endif
58
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
59
0
        return false;
60
0
    }
61
62
8
    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
8
    return false;
87
8
}
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
52
44.8k
                                                             std::string* err_msg) const {
53
44.8k
#ifdef BE_TEST
54
44.8k
    if (!doris::pthread_context_ptr_init) {
55
600
        return false;
56
600
    }
57
44.2k
#endif
58
44.2k
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
59
0
        return false;
60
0
    }
61
62
44.2k
    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
44.2k
    return false;
87
44.2k
}
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
52
8
                                                             std::string* err_msg) const {
53
8
#ifdef BE_TEST
54
8
    if (!doris::pthread_context_ptr_init) {
55
0
        return false;
56
0
    }
57
8
#endif
58
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
59
0
        return false;
60
0
    }
61
62
8
    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
8
    return false;
87
8
}
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
52
8
                                                             std::string* err_msg) const {
53
8
#ifdef BE_TEST
54
8
    if (!doris::pthread_context_ptr_init) {
55
0
        return false;
56
0
    }
57
8
#endif
58
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
59
0
        return false;
60
0
    }
61
62
8
    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
8
    return false;
87
8
}
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
52
8
                                                             std::string* err_msg) const {
53
8
#ifdef BE_TEST
54
8
    if (!doris::pthread_context_ptr_init) {
55
0
        return false;
56
0
    }
57
8
#endif
58
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
59
0
        return false;
60
0
    }
61
62
8
    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
8
    return false;
87
8
}
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
52
6.05M
                                                             std::string* err_msg) const {
53
6.05M
#ifdef BE_TEST
54
6.05M
    if (!doris::pthread_context_ptr_init) {
55
629k
        return false;
56
629k
    }
57
5.42M
#endif
58
5.42M
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
59
0
        return false;
60
0
    }
61
62
5.42M
    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
5.42M
    return false;
87
5.42M
}
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
Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE17sys_memory_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
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
7.59k
                                                             std::string* err_msg) const {
53
7.59k
#ifdef BE_TEST
54
7.59k
    if (!doris::pthread_context_ptr_init) {
55
0
        return false;
56
0
    }
57
7.59k
#endif
58
7.59k
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
59
0
        return false;
60
0
    }
61
62
7.59k
    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
7.59k
    return false;
87
7.59k
}
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
6.11M
               check_and_tracking_memory>::alloc_fault_probability() const {
93
6.11M
#ifdef BE_TEST
94
6.11M
    if (!doris::pthread_context_ptr_init) {
95
631k
        return;
96
631k
    }
97
5.48M
#endif
98
5.48M
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
99
0
        return;
100
0
    }
101
102
5.48M
    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
5.48M
}
_ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv
Line
Count
Source
92
8
               check_and_tracking_memory>::alloc_fault_probability() const {
93
8
#ifdef BE_TEST
94
8
    if (!doris::pthread_context_ptr_init) {
95
0
        return;
96
0
    }
97
8
#endif
98
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
99
0
        return;
100
0
    }
101
102
8
    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
8
}
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv
Line
Count
Source
92
1.68k
               check_and_tracking_memory>::alloc_fault_probability() const {
93
1.68k
#ifdef BE_TEST
94
1.68k
    if (!doris::pthread_context_ptr_init) {
95
0
        return;
96
0
    }
97
1.68k
#endif
98
1.68k
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
99
0
        return;
100
0
    }
101
102
1.68k
    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
1.68k
}
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv
Line
Count
Source
92
8
               check_and_tracking_memory>::alloc_fault_probability() const {
93
8
#ifdef BE_TEST
94
8
    if (!doris::pthread_context_ptr_init) {
95
0
        return;
96
0
    }
97
8
#endif
98
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
99
0
        return;
100
0
    }
101
102
8
    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
8
}
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv
Line
Count
Source
92
44.8k
               check_and_tracking_memory>::alloc_fault_probability() const {
93
44.8k
#ifdef BE_TEST
94
44.8k
    if (!doris::pthread_context_ptr_init) {
95
600
        return;
96
600
    }
97
44.2k
#endif
98
44.2k
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
99
0
        return;
100
0
    }
101
102
44.2k
    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
44.2k
}
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv
Line
Count
Source
92
8
               check_and_tracking_memory>::alloc_fault_probability() const {
93
8
#ifdef BE_TEST
94
8
    if (!doris::pthread_context_ptr_init) {
95
0
        return;
96
0
    }
97
8
#endif
98
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
99
0
        return;
100
0
    }
101
102
8
    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
8
}
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv
Line
Count
Source
92
8
               check_and_tracking_memory>::alloc_fault_probability() const {
93
8
#ifdef BE_TEST
94
8
    if (!doris::pthread_context_ptr_init) {
95
0
        return;
96
0
    }
97
8
#endif
98
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
99
0
        return;
100
0
    }
101
102
8
    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
8
}
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv
Line
Count
Source
92
8
               check_and_tracking_memory>::alloc_fault_probability() const {
93
8
#ifdef BE_TEST
94
8
    if (!doris::pthread_context_ptr_init) {
95
0
        return;
96
0
    }
97
8
#endif
98
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
99
0
        return;
100
0
    }
101
102
8
    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
8
}
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE23alloc_fault_probabilityEv
Line
Count
Source
92
6.05M
               check_and_tracking_memory>::alloc_fault_probability() const {
93
6.05M
#ifdef BE_TEST
94
6.05M
    if (!doris::pthread_context_ptr_init) {
95
630k
        return;
96
630k
    }
97
5.42M
#endif
98
5.42M
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
99
0
        return;
100
0
    }
101
102
5.42M
    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
5.42M
}
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
7.59k
               check_and_tracking_memory>::alloc_fault_probability() const {
93
7.59k
#ifdef BE_TEST
94
7.59k
    if (!doris::pthread_context_ptr_init) {
95
0
        return;
96
0
    }
97
7.59k
#endif
98
7.59k
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
99
0
        return;
100
0
    }
101
102
7.59k
    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
7.59k
}
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
6.11M
               check_and_tracking_memory>::sys_memory_check(size_t size) const {
131
6.11M
    std::string err_msg;
132
6.11M
    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
6.11M
}
_ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm
Line
Count
Source
130
8
               check_and_tracking_memory>::sys_memory_check(size_t size) const {
131
8
    std::string err_msg;
132
8
    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
8
}
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm
Line
Count
Source
130
1.68k
               check_and_tracking_memory>::sys_memory_check(size_t size) const {
131
1.68k
    std::string err_msg;
132
1.68k
    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
1.68k
}
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm
Line
Count
Source
130
8
               check_and_tracking_memory>::sys_memory_check(size_t size) const {
131
8
    std::string err_msg;
132
8
    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
8
}
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm
Line
Count
Source
130
44.8k
               check_and_tracking_memory>::sys_memory_check(size_t size) const {
131
44.8k
    std::string err_msg;
132
44.8k
    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
44.8k
}
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm
Line
Count
Source
130
8
               check_and_tracking_memory>::sys_memory_check(size_t size) const {
131
8
    std::string err_msg;
132
8
    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
8
}
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm
Line
Count
Source
130
8
               check_and_tracking_memory>::sys_memory_check(size_t size) const {
131
8
    std::string err_msg;
132
8
    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
8
}
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm
Line
Count
Source
130
8
               check_and_tracking_memory>::sys_memory_check(size_t size) const {
131
8
    std::string err_msg;
132
8
    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
8
}
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE16sys_memory_checkEm
Line
Count
Source
130
6.05M
               check_and_tracking_memory>::sys_memory_check(size_t size) const {
131
6.05M
    std::string err_msg;
132
6.05M
    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
6.05M
}
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
7.59k
               check_and_tracking_memory>::sys_memory_check(size_t size) const {
131
7.59k
    std::string err_msg;
132
7.59k
    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
7.59k
}
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
6.11M
                                                                 std::string* err_msg) const {
202
6.11M
#ifdef BE_TEST
203
6.11M
    if (!doris::pthread_context_ptr_init) {
204
630k
        return false;
205
630k
    }
206
5.48M
#endif
207
5.48M
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
208
0
        return false;
209
0
    }
210
211
5.48M
    auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit(
212
5.48M
            size);
213
5.48M
    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
5.48M
    return false;
220
5.48M
}
_ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
201
8
                                                                 std::string* err_msg) const {
202
8
#ifdef BE_TEST
203
8
    if (!doris::pthread_context_ptr_init) {
204
0
        return false;
205
0
    }
206
8
#endif
207
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
208
0
        return false;
209
0
    }
210
211
8
    auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit(
212
8
            size);
213
8
    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
8
    return false;
220
8
}
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
201
1.68k
                                                                 std::string* err_msg) const {
202
1.68k
#ifdef BE_TEST
203
1.68k
    if (!doris::pthread_context_ptr_init) {
204
0
        return false;
205
0
    }
206
1.68k
#endif
207
1.68k
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
208
0
        return false;
209
0
    }
210
211
1.68k
    auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit(
212
1.68k
            size);
213
1.68k
    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
1.68k
    return false;
220
1.68k
}
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
201
8
                                                                 std::string* err_msg) const {
202
8
#ifdef BE_TEST
203
8
    if (!doris::pthread_context_ptr_init) {
204
0
        return false;
205
0
    }
206
8
#endif
207
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
208
0
        return false;
209
0
    }
210
211
8
    auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit(
212
8
            size);
213
8
    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
8
    return false;
220
8
}
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
201
44.8k
                                                                 std::string* err_msg) const {
202
44.8k
#ifdef BE_TEST
203
44.8k
    if (!doris::pthread_context_ptr_init) {
204
600
        return false;
205
600
    }
206
44.2k
#endif
207
44.2k
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
208
0
        return false;
209
0
    }
210
211
44.2k
    auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit(
212
44.2k
            size);
213
44.2k
    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
44.2k
    return false;
220
44.2k
}
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
201
8
                                                                 std::string* err_msg) const {
202
8
#ifdef BE_TEST
203
8
    if (!doris::pthread_context_ptr_init) {
204
0
        return false;
205
0
    }
206
8
#endif
207
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
208
0
        return false;
209
0
    }
210
211
8
    auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit(
212
8
            size);
213
8
    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
8
    return false;
220
8
}
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
201
8
                                                                 std::string* err_msg) const {
202
8
#ifdef BE_TEST
203
8
    if (!doris::pthread_context_ptr_init) {
204
0
        return false;
205
0
    }
206
8
#endif
207
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
208
0
        return false;
209
0
    }
210
211
8
    auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit(
212
8
            size);
213
8
    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
8
    return false;
220
8
}
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
201
8
                                                                 std::string* err_msg) const {
202
8
#ifdef BE_TEST
203
8
    if (!doris::pthread_context_ptr_init) {
204
0
        return false;
205
0
    }
206
8
#endif
207
8
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
208
0
        return false;
209
0
    }
210
211
8
    auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit(
212
8
            size);
213
8
    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
8
    return false;
220
8
}
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
Line
Count
Source
201
6.05M
                                                                 std::string* err_msg) const {
202
6.05M
#ifdef BE_TEST
203
6.05M
    if (!doris::pthread_context_ptr_init) {
204
630k
        return false;
205
630k
    }
206
5.42M
#endif
207
5.42M
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
208
0
        return false;
209
0
    }
210
211
5.42M
    auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit(
212
5.42M
            size);
213
5.42M
    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
5.42M
    return false;
220
5.42M
}
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
Unexecuted instantiation: _ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE21memory_tracker_exceedEmPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
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
7.59k
                                                                 std::string* err_msg) const {
202
7.59k
#ifdef BE_TEST
203
7.59k
    if (!doris::pthread_context_ptr_init) {
204
0
        return false;
205
0
    }
206
7.59k
#endif
207
7.59k
    if (UNLIKELY(doris::thread_context()->thread_mem_tracker_mgr->skip_memory_check != 0)) {
208
0
        return false;
209
0
    }
210
211
7.59k
    auto st = doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->check_limit(
212
7.59k
            size);
213
7.59k
    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
7.59k
    return false;
220
7.59k
}
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
6.11M
               check_and_tracking_memory>::memory_tracker_check(size_t size) const {
226
6.11M
    std::string err_msg;
227
6.11M
    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
6.11M
}
_ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm
Line
Count
Source
225
8
               check_and_tracking_memory>::memory_tracker_check(size_t size) const {
226
8
    std::string err_msg;
227
8
    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
8
}
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm
Line
Count
Source
225
1.68k
               check_and_tracking_memory>::memory_tracker_check(size_t size) const {
226
1.68k
    std::string err_msg;
227
1.68k
    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
1.68k
}
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm
Line
Count
Source
225
8
               check_and_tracking_memory>::memory_tracker_check(size_t size) const {
226
8
    std::string err_msg;
227
8
    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
8
}
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm
Line
Count
Source
225
44.8k
               check_and_tracking_memory>::memory_tracker_check(size_t size) const {
226
44.8k
    std::string err_msg;
227
44.8k
    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
44.8k
}
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm
Line
Count
Source
225
8
               check_and_tracking_memory>::memory_tracker_check(size_t size) const {
226
8
    std::string err_msg;
227
8
    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
8
}
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm
Line
Count
Source
225
8
               check_and_tracking_memory>::memory_tracker_check(size_t size) const {
226
8
    std::string err_msg;
227
8
    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
8
}
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm
Line
Count
Source
225
8
               check_and_tracking_memory>::memory_tracker_check(size_t size) const {
226
8
    std::string err_msg;
227
8
    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
8
}
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE20memory_tracker_checkEm
Line
Count
Source
225
6.05M
               check_and_tracking_memory>::memory_tracker_check(size_t size) const {
226
6.05M
    std::string err_msg;
227
6.05M
    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
6.05M
}
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
7.59k
               check_and_tracking_memory>::memory_tracker_check(size_t size) const {
226
7.59k
    std::string err_msg;
227
7.59k
    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
7.59k
}
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
6.10M
               check_and_tracking_memory>::memory_check(size_t size) const {
244
6.10M
    if (check_and_tracking_memory) {
245
6.10M
        alloc_fault_probability();
246
6.10M
        sys_memory_check(size);
247
6.10M
        memory_tracker_check(size);
248
6.10M
    }
249
6.10M
}
_ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm
Line
Count
Source
243
8
               check_and_tracking_memory>::memory_check(size_t size) const {
244
8
    if (check_and_tracking_memory) {
245
8
        alloc_fault_probability();
246
8
        sys_memory_check(size);
247
8
        memory_tracker_check(size);
248
8
    }
249
8
}
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm
Line
Count
Source
243
1.68k
               check_and_tracking_memory>::memory_check(size_t size) const {
244
1.68k
    if (check_and_tracking_memory) {
245
1.68k
        alloc_fault_probability();
246
1.68k
        sys_memory_check(size);
247
1.68k
        memory_tracker_check(size);
248
1.68k
    }
249
1.68k
}
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm
Line
Count
Source
243
8
               check_and_tracking_memory>::memory_check(size_t size) const {
244
8
    if (check_and_tracking_memory) {
245
8
        alloc_fault_probability();
246
8
        sys_memory_check(size);
247
8
        memory_tracker_check(size);
248
8
    }
249
8
}
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm
Line
Count
Source
243
44.8k
               check_and_tracking_memory>::memory_check(size_t size) const {
244
44.8k
    if (check_and_tracking_memory) {
245
44.8k
        alloc_fault_probability();
246
44.8k
        sys_memory_check(size);
247
44.8k
        memory_tracker_check(size);
248
44.8k
    }
249
44.8k
}
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm
Line
Count
Source
243
8
               check_and_tracking_memory>::memory_check(size_t size) const {
244
8
    if (check_and_tracking_memory) {
245
8
        alloc_fault_probability();
246
8
        sys_memory_check(size);
247
8
        memory_tracker_check(size);
248
8
    }
249
8
}
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm
Line
Count
Source
243
8
               check_and_tracking_memory>::memory_check(size_t size) const {
244
8
    if (check_and_tracking_memory) {
245
8
        alloc_fault_probability();
246
8
        sys_memory_check(size);
247
8
        memory_tracker_check(size);
248
8
    }
249
8
}
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm
Line
Count
Source
243
8
               check_and_tracking_memory>::memory_check(size_t size) const {
244
8
    if (check_and_tracking_memory) {
245
8
        alloc_fault_probability();
246
8
        sys_memory_check(size);
247
8
        memory_tracker_check(size);
248
8
    }
249
8
}
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE12memory_checkEm
Line
Count
Source
243
6.05M
               check_and_tracking_memory>::memory_check(size_t size) const {
244
6.05M
    if (check_and_tracking_memory) {
245
6.05M
        alloc_fault_probability();
246
6.05M
        sys_memory_check(size);
247
6.05M
        memory_tracker_check(size);
248
6.05M
    }
249
6.05M
}
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
14
               check_and_tracking_memory>::memory_check(size_t size) const {
244
14
    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
14
}
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
7.59k
               check_and_tracking_memory>::memory_check(size_t size) const {
244
7.59k
    if (check_and_tracking_memory) {
245
7.59k
        alloc_fault_probability();
246
7.59k
        sys_memory_check(size);
247
7.59k
        memory_tracker_check(size);
248
7.59k
    }
249
7.59k
}
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
6.11M
               check_and_tracking_memory>::consume_memory(size_t size) const {
255
6.11M
    if (check_and_tracking_memory) {
256
6.11M
        CONSUME_THREAD_MEM_TRACKER(size);
257
6.11M
    }
258
6.11M
}
_ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm
Line
Count
Source
254
8
               check_and_tracking_memory>::consume_memory(size_t size) const {
255
8
    if (check_and_tracking_memory) {
256
        CONSUME_THREAD_MEM_TRACKER(size);
257
8
    }
258
8
}
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm
Line
Count
Source
254
1.68k
               check_and_tracking_memory>::consume_memory(size_t size) const {
255
1.68k
    if (check_and_tracking_memory) {
256
        CONSUME_THREAD_MEM_TRACKER(size);
257
1.68k
    }
258
1.68k
}
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm
Line
Count
Source
254
8
               check_and_tracking_memory>::consume_memory(size_t size) const {
255
8
    if (check_and_tracking_memory) {
256
        CONSUME_THREAD_MEM_TRACKER(size);
257
8
    }
258
8
}
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm
Line
Count
Source
254
44.8k
               check_and_tracking_memory>::consume_memory(size_t size) const {
255
44.8k
    if (check_and_tracking_memory) {
256
        CONSUME_THREAD_MEM_TRACKER(size);
257
44.8k
    }
258
44.8k
}
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm
Line
Count
Source
254
8
               check_and_tracking_memory>::consume_memory(size_t size) const {
255
8
    if (check_and_tracking_memory) {
256
        CONSUME_THREAD_MEM_TRACKER(size);
257
8
    }
258
8
}
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm
Line
Count
Source
254
8
               check_and_tracking_memory>::consume_memory(size_t size) const {
255
8
    if (check_and_tracking_memory) {
256
        CONSUME_THREAD_MEM_TRACKER(size);
257
8
    }
258
8
}
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm
Line
Count
Source
254
8
               check_and_tracking_memory>::consume_memory(size_t size) const {
255
8
    if (check_and_tracking_memory) {
256
        CONSUME_THREAD_MEM_TRACKER(size);
257
8
    }
258
8
}
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE14consume_memoryEm
Line
Count
Source
254
6.05M
               check_and_tracking_memory>::consume_memory(size_t size) const {
255
6.05M
    if (check_and_tracking_memory) {
256
        CONSUME_THREAD_MEM_TRACKER(size);
257
6.05M
    }
258
6.05M
}
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
14
               check_and_tracking_memory>::consume_memory(size_t size) const {
255
14
    if (check_and_tracking_memory) {
256
        CONSUME_THREAD_MEM_TRACKER(size);
257
0
    }
258
14
}
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
7.59k
               check_and_tracking_memory>::consume_memory(size_t size) const {
255
7.59k
    if (check_and_tracking_memory) {
256
        CONSUME_THREAD_MEM_TRACKER(size);
257
7.59k
    }
258
7.59k
}
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
6.10M
               check_and_tracking_memory>::release_memory(size_t size) const {
264
6.10M
    if (check_and_tracking_memory) {
265
6.10M
        RELEASE_THREAD_MEM_TRACKER(size);
266
6.10M
    }
267
6.10M
}
_ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm
Line
Count
Source
263
8
               check_and_tracking_memory>::release_memory(size_t size) const {
264
8
    if (check_and_tracking_memory) {
265
        RELEASE_THREAD_MEM_TRACKER(size);
266
8
    }
267
8
}
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm
Line
Count
Source
263
1.68k
               check_and_tracking_memory>::release_memory(size_t size) const {
264
1.68k
    if (check_and_tracking_memory) {
265
        RELEASE_THREAD_MEM_TRACKER(size);
266
1.68k
    }
267
1.68k
}
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm
Line
Count
Source
263
8
               check_and_tracking_memory>::release_memory(size_t size) const {
264
8
    if (check_and_tracking_memory) {
265
        RELEASE_THREAD_MEM_TRACKER(size);
266
8
    }
267
8
}
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm
Line
Count
Source
263
44.8k
               check_and_tracking_memory>::release_memory(size_t size) const {
264
44.8k
    if (check_and_tracking_memory) {
265
        RELEASE_THREAD_MEM_TRACKER(size);
266
44.8k
    }
267
44.8k
}
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm
Line
Count
Source
263
8
               check_and_tracking_memory>::release_memory(size_t size) const {
264
8
    if (check_and_tracking_memory) {
265
        RELEASE_THREAD_MEM_TRACKER(size);
266
8
    }
267
8
}
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm
Line
Count
Source
263
8
               check_and_tracking_memory>::release_memory(size_t size) const {
264
8
    if (check_and_tracking_memory) {
265
        RELEASE_THREAD_MEM_TRACKER(size);
266
8
    }
267
8
}
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm
Line
Count
Source
263
8
               check_and_tracking_memory>::release_memory(size_t size) const {
264
8
    if (check_and_tracking_memory) {
265
        RELEASE_THREAD_MEM_TRACKER(size);
266
8
    }
267
8
}
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE14release_memoryEm
Line
Count
Source
263
6.04M
               check_and_tracking_memory>::release_memory(size_t size) const {
264
6.04M
    if (check_and_tracking_memory) {
265
        RELEASE_THREAD_MEM_TRACKER(size);
266
6.04M
    }
267
6.04M
}
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
14
               check_and_tracking_memory>::release_memory(size_t size) const {
264
14
    if (check_and_tracking_memory) {
265
        RELEASE_THREAD_MEM_TRACKER(size);
266
0
    }
267
14
}
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
7.59k
               check_and_tracking_memory>::release_memory(size_t size) const {
264
7.59k
    if (check_and_tracking_memory) {
265
        RELEASE_THREAD_MEM_TRACKER(size);
266
7.59k
    }
267
7.59k
}
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
6.11M
               check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const {
285
6.11M
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
286
6.11M
        return;
287
6.11M
    }
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
8
               check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const {
285
8
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
286
8
        return;
287
8
    }
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
1.68k
               check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const {
285
1.68k
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
286
1.68k
        return;
287
1.68k
    }
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
8
               check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const {
285
8
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
286
8
        return;
287
8
    }
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
44.8k
               check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const {
285
44.8k
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
286
44.8k
        return;
287
44.8k
    }
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
8
               check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const {
285
8
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
286
8
        return;
287
8
    }
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
8
               check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const {
285
8
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
286
8
        return;
287
8
    }
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
8
               check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const {
285
8
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
286
8
        return;
287
8
    }
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
6.05M
               check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const {
285
6.05M
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
286
6.05M
        return;
287
6.05M
    }
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_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
14
               check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const {
285
14
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
286
14
        return;
287
14
    }
288
0
    doris::thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->add_address_sanitizers(
289
0
            buf, size);
290
0
}
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
7.59k
               check_and_tracking_memory>::add_address_sanitizers(void* buf, size_t size) const {
285
7.59k
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
286
7.59k
        return;
287
7.59k
    }
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
6.10M
               check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const {
296
6.10M
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
297
6.10M
        return;
298
6.10M
    }
299
18.4E
    doris::thread_context()
300
18.4E
            ->thread_mem_tracker_mgr->limiter_mem_tracker()
301
18.4E
            ->remove_address_sanitizers(buf, size);
302
18.4E
}
_ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE25remove_address_sanitizersEPvm
Line
Count
Source
295
8
               check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const {
296
8
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
297
8
        return;
298
8
    }
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
1.68k
               check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const {
296
1.68k
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
297
1.68k
        return;
298
1.68k
    }
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
8
               check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const {
296
8
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
297
8
        return;
298
8
    }
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
44.8k
               check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const {
296
44.8k
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
297
44.8k
        return;
298
44.8k
    }
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
8
               check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const {
296
8
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
297
8
        return;
298
8
    }
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
8
               check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const {
296
8
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
297
8
        return;
298
8
    }
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
8
               check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const {
296
8
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
297
8
        return;
298
8
    }
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
6.04M
               check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const {
296
6.04M
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
297
6.04M
        return;
298
6.04M
    }
299
18.4E
    doris::thread_context()
300
18.4E
            ->thread_mem_tracker_mgr->limiter_mem_tracker()
301
18.4E
            ->remove_address_sanitizers(buf, size);
302
18.4E
}
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
14
               check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const {
296
14
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
297
14
        return;
298
14
    }
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_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
7.59k
               check_and_tracking_memory>::remove_address_sanitizers(void* buf, size_t size) const {
296
7.59k
    if (!doris::config::crash_in_memory_tracker_inaccurate) {
297
7.59k
        return;
298
7.59k
    }
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
5.56M
                check_and_tracking_memory>::alloc(size_t size, size_t alignment) {
308
5.56M
    memory_check(size);
309
    // consume memory in tracker before alloc, similar to early declaration.
310
5.56M
    consume_memory(size);
311
5.56M
    void* buf;
312
5.56M
    size_t record_size = size;
313
314
5.56M
    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
5.56M
    } else {
333
5.56M
        if (alignment <= MALLOC_MIN_ALIGNMENT) {
334
5.47M
            if constexpr (clear_memory) {
335
46.2k
                buf = MemoryAllocator::calloc(size, 1);
336
5.42M
            } else {
337
5.42M
                buf = MemoryAllocator::malloc(size);
338
5.42M
            }
339
340
5.47M
            if (nullptr == buf) {
341
0
                release_memory(size);
342
0
                throw_bad_alloc(fmt::format("Allocator: Cannot malloc {}.", size));
343
0
            }
344
5.47M
            if constexpr (MemoryAllocator::need_record_actual_size()) {
345
0
                record_size = MemoryAllocator::allocated_size(buf);
346
0
            }
347
5.47M
            add_address_sanitizers(buf, record_size);
348
5.47M
        } else {
349
95.4k
            buf = nullptr;
350
95.4k
            int res = MemoryAllocator::posix_memalign(&buf, alignment, size);
351
352
95.4k
            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
95.4k
            if constexpr (clear_memory) {
358
0
                memset(buf, 0, size);
359
0
            }
360
361
95.4k
            if constexpr (MemoryAllocator::need_record_actual_size()) {
362
0
                record_size = MemoryAllocator::allocated_size(buf);
363
0
            }
364
95.4k
            add_address_sanitizers(buf, record_size);
365
95.4k
        }
366
5.56M
    }
367
5.56M
    if constexpr (MemoryAllocator::need_record_actual_size()) {
368
0
        consume_memory(record_size - size);
369
0
    }
370
5.56M
    return buf;
371
5.56M
}
_ZN5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE5allocEmm
Line
Count
Source
307
4
                check_and_tracking_memory>::alloc(size_t size, size_t alignment) {
308
4
    memory_check(size);
309
    // consume memory in tracker before alloc, similar to early declaration.
310
4
    consume_memory(size);
311
4
    void* buf;
312
4
    size_t record_size = size;
313
314
4
    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
4
    } else {
333
4
        if (alignment <= MALLOC_MIN_ALIGNMENT) {
334
4
            if constexpr (clear_memory) {
335
4
                buf = MemoryAllocator::calloc(size, 1);
336
            } else {
337
                buf = MemoryAllocator::malloc(size);
338
            }
339
340
4
            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
4
            add_address_sanitizers(buf, record_size);
348
4
        } 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
4
    }
367
    if constexpr (MemoryAllocator::need_record_actual_size()) {
368
        consume_memory(record_size - size);
369
    }
370
4
    return buf;
371
4
}
_ZN5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE5allocEmm
Line
Count
Source
307
1.42k
                check_and_tracking_memory>::alloc(size_t size, size_t alignment) {
308
1.42k
    memory_check(size);
309
    // consume memory in tracker before alloc, similar to early declaration.
310
1.42k
    consume_memory(size);
311
1.42k
    void* buf;
312
1.42k
    size_t record_size = size;
313
314
1.42k
    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
1.42k
    } else {
333
1.42k
        if (alignment <= MALLOC_MIN_ALIGNMENT) {
334
1.42k
            if constexpr (clear_memory) {
335
1.42k
                buf = MemoryAllocator::calloc(size, 1);
336
            } else {
337
                buf = MemoryAllocator::malloc(size);
338
            }
339
340
1.42k
            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
1.42k
            add_address_sanitizers(buf, record_size);
348
1.42k
        } 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
1.42k
    }
367
    if constexpr (MemoryAllocator::need_record_actual_size()) {
368
        consume_memory(record_size - size);
369
    }
370
1.42k
    return buf;
371
1.42k
}
_ZN5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE5allocEmm
Line
Count
Source
307
4
                check_and_tracking_memory>::alloc(size_t size, size_t alignment) {
308
4
    memory_check(size);
309
    // consume memory in tracker before alloc, similar to early declaration.
310
4
    consume_memory(size);
311
4
    void* buf;
312
4
    size_t record_size = size;
313
314
4
    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
4
    } else {
333
4
        if (alignment <= MALLOC_MIN_ALIGNMENT) {
334
4
            if constexpr (clear_memory) {
335
4
                buf = MemoryAllocator::calloc(size, 1);
336
            } else {
337
                buf = MemoryAllocator::malloc(size);
338
            }
339
340
4
            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
4
            add_address_sanitizers(buf, record_size);
348
4
        } 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
4
    }
367
    if constexpr (MemoryAllocator::need_record_actual_size()) {
368
        consume_memory(record_size - size);
369
    }
370
4
    return buf;
371
4
}
_ZN5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE5allocEmm
Line
Count
Source
307
44.8k
                check_and_tracking_memory>::alloc(size_t size, size_t alignment) {
308
44.8k
    memory_check(size);
309
    // consume memory in tracker before alloc, similar to early declaration.
310
44.8k
    consume_memory(size);
311
44.8k
    void* buf;
312
44.8k
    size_t record_size = size;
313
314
44.8k
    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
44.8k
    } else {
333
44.8k
        if (alignment <= MALLOC_MIN_ALIGNMENT) {
334
44.8k
            if constexpr (clear_memory) {
335
44.8k
                buf = MemoryAllocator::calloc(size, 1);
336
            } else {
337
                buf = MemoryAllocator::malloc(size);
338
            }
339
340
44.8k
            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
44.8k
            add_address_sanitizers(buf, record_size);
348
44.8k
        } 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
44.8k
    }
367
    if constexpr (MemoryAllocator::need_record_actual_size()) {
368
        consume_memory(record_size - size);
369
    }
370
44.8k
    return buf;
371
44.8k
}
_ZN5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE5allocEmm
Line
Count
Source
307
4
                check_and_tracking_memory>::alloc(size_t size, size_t alignment) {
308
4
    memory_check(size);
309
    // consume memory in tracker before alloc, similar to early declaration.
310
4
    consume_memory(size);
311
4
    void* buf;
312
4
    size_t record_size = size;
313
314
4
    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
4
    } else {
333
4
        if (alignment <= MALLOC_MIN_ALIGNMENT) {
334
            if constexpr (clear_memory) {
335
                buf = MemoryAllocator::calloc(size, 1);
336
4
            } else {
337
4
                buf = MemoryAllocator::malloc(size);
338
4
            }
339
340
4
            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
4
            add_address_sanitizers(buf, record_size);
348
4
        } 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
4
    }
367
    if constexpr (MemoryAllocator::need_record_actual_size()) {
368
        consume_memory(record_size - size);
369
    }
370
4
    return buf;
371
4
}
_ZN5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE5allocEmm
Line
Count
Source
307
4
                check_and_tracking_memory>::alloc(size_t size, size_t alignment) {
308
4
    memory_check(size);
309
    // consume memory in tracker before alloc, similar to early declaration.
310
4
    consume_memory(size);
311
4
    void* buf;
312
4
    size_t record_size = size;
313
314
4
    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
4
    } else {
333
4
        if (alignment <= MALLOC_MIN_ALIGNMENT) {
334
            if constexpr (clear_memory) {
335
                buf = MemoryAllocator::calloc(size, 1);
336
4
            } else {
337
4
                buf = MemoryAllocator::malloc(size);
338
4
            }
339
340
4
            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
4
            add_address_sanitizers(buf, record_size);
348
4
        } 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
4
    }
367
    if constexpr (MemoryAllocator::need_record_actual_size()) {
368
        consume_memory(record_size - size);
369
    }
370
4
    return buf;
371
4
}
_ZN5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE5allocEmm
Line
Count
Source
307
4
                check_and_tracking_memory>::alloc(size_t size, size_t alignment) {
308
4
    memory_check(size);
309
    // consume memory in tracker before alloc, similar to early declaration.
310
4
    consume_memory(size);
311
4
    void* buf;
312
4
    size_t record_size = size;
313
314
4
    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
4
    } else {
333
4
        if (alignment <= MALLOC_MIN_ALIGNMENT) {
334
            if constexpr (clear_memory) {
335
                buf = MemoryAllocator::calloc(size, 1);
336
4
            } else {
337
4
                buf = MemoryAllocator::malloc(size);
338
4
            }
339
340
4
            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
4
            add_address_sanitizers(buf, record_size);
348
4
        } 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
4
    }
367
    if constexpr (MemoryAllocator::need_record_actual_size()) {
368
        consume_memory(record_size - size);
369
    }
370
4
    return buf;
371
4
}
_ZN5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE5allocEmm
Line
Count
Source
307
5.51M
                check_and_tracking_memory>::alloc(size_t size, size_t alignment) {
308
5.51M
    memory_check(size);
309
    // consume memory in tracker before alloc, similar to early declaration.
310
5.51M
    consume_memory(size);
311
5.51M
    void* buf;
312
5.51M
    size_t record_size = size;
313
314
5.51M
    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
5.51M
    } else {
333
5.51M
        if (alignment <= MALLOC_MIN_ALIGNMENT) {
334
            if constexpr (clear_memory) {
335
                buf = MemoryAllocator::calloc(size, 1);
336
5.41M
            } else {
337
5.41M
                buf = MemoryAllocator::malloc(size);
338
5.41M
            }
339
340
5.41M
            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
5.41M
            add_address_sanitizers(buf, record_size);
348
5.41M
        } else {
349
95.4k
            buf = nullptr;
350
95.4k
            int res = MemoryAllocator::posix_memalign(&buf, alignment, size);
351
352
95.4k
            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
95.4k
            add_address_sanitizers(buf, record_size);
365
95.4k
        }
366
5.51M
    }
367
    if constexpr (MemoryAllocator::need_record_actual_size()) {
368
        consume_memory(record_size - size);
369
    }
370
5.51M
    return buf;
371
5.51M
}
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
14
                check_and_tracking_memory>::alloc(size_t size, size_t alignment) {
308
14
    memory_check(size);
309
    // consume memory in tracker before alloc, similar to early declaration.
310
14
    consume_memory(size);
311
14
    void* buf;
312
14
    size_t record_size = size;
313
314
14
    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
14
    } else {
333
14
        if (alignment <= MALLOC_MIN_ALIGNMENT) {
334
            if constexpr (clear_memory) {
335
                buf = MemoryAllocator::calloc(size, 1);
336
14
            } else {
337
14
                buf = MemoryAllocator::malloc(size);
338
14
            }
339
340
14
            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
14
            add_address_sanitizers(buf, record_size);
348
14
        } 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
14
    }
367
    if constexpr (MemoryAllocator::need_record_actual_size()) {
368
        consume_memory(record_size - size);
369
    }
370
14
    return buf;
371
14
}
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
7.59k
                check_and_tracking_memory>::alloc(size_t size, size_t alignment) {
308
7.59k
    memory_check(size);
309
    // consume memory in tracker before alloc, similar to early declaration.
310
7.59k
    consume_memory(size);
311
7.59k
    void* buf;
312
7.59k
    size_t record_size = size;
313
314
7.59k
    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
7.59k
    } else {
333
7.59k
        if (alignment <= MALLOC_MIN_ALIGNMENT) {
334
            if constexpr (clear_memory) {
335
                buf = MemoryAllocator::calloc(size, 1);
336
7.59k
            } else {
337
7.59k
                buf = MemoryAllocator::malloc(size);
338
7.59k
            }
339
340
7.59k
            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
7.59k
            add_address_sanitizers(buf, record_size);
348
7.59k
        } 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
7.59k
    }
367
    if constexpr (MemoryAllocator::need_record_actual_size()) {
368
        consume_memory(record_size - size);
369
    }
370
7.59k
    return buf;
371
7.59k
}
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
5.56M
               check_and_tracking_memory>::free(void* buf, size_t size) const {
377
5.56M
    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
5.56M
    } else {
382
5.56M
        remove_address_sanitizers(buf, size);
383
5.56M
        MemoryAllocator::free(buf);
384
5.56M
    }
385
5.56M
    release_memory(size);
386
5.56M
}
_ZNK5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm
Line
Count
Source
376
4
               check_and_tracking_memory>::free(void* buf, size_t size) const {
377
4
    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
4
    } else {
382
4
        remove_address_sanitizers(buf, size);
383
4
        MemoryAllocator::free(buf);
384
4
    }
385
4
    release_memory(size);
386
4
}
_ZNK5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm
Line
Count
Source
376
1.42k
               check_and_tracking_memory>::free(void* buf, size_t size) const {
377
1.42k
    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
1.42k
    } else {
382
1.42k
        remove_address_sanitizers(buf, size);
383
1.42k
        MemoryAllocator::free(buf);
384
1.42k
    }
385
1.42k
    release_memory(size);
386
1.42k
}
_ZNK5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm
Line
Count
Source
376
4
               check_and_tracking_memory>::free(void* buf, size_t size) const {
377
4
    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
4
    } else {
382
4
        remove_address_sanitizers(buf, size);
383
4
        MemoryAllocator::free(buf);
384
4
    }
385
4
    release_memory(size);
386
4
}
_ZNK5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm
Line
Count
Source
376
44.8k
               check_and_tracking_memory>::free(void* buf, size_t size) const {
377
44.8k
    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
44.8k
    } else {
382
44.8k
        remove_address_sanitizers(buf, size);
383
44.8k
        MemoryAllocator::free(buf);
384
44.8k
    }
385
44.8k
    release_memory(size);
386
44.8k
}
_ZNK5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm
Line
Count
Source
376
4
               check_and_tracking_memory>::free(void* buf, size_t size) const {
377
4
    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
4
    } else {
382
4
        remove_address_sanitizers(buf, size);
383
4
        MemoryAllocator::free(buf);
384
4
    }
385
4
    release_memory(size);
386
4
}
_ZNK5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm
Line
Count
Source
376
4
               check_and_tracking_memory>::free(void* buf, size_t size) const {
377
4
    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
4
    } else {
382
4
        remove_address_sanitizers(buf, size);
383
4
        MemoryAllocator::free(buf);
384
4
    }
385
4
    release_memory(size);
386
4
}
_ZNK5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm
Line
Count
Source
376
4
               check_and_tracking_memory>::free(void* buf, size_t size) const {
377
4
    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
4
    } else {
382
4
        remove_address_sanitizers(buf, size);
383
4
        MemoryAllocator::free(buf);
384
4
    }
385
4
    release_memory(size);
386
4
}
_ZNK5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE4freeEPvm
Line
Count
Source
376
5.50M
               check_and_tracking_memory>::free(void* buf, size_t size) const {
377
5.50M
    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
5.50M
    } else {
382
5.50M
        remove_address_sanitizers(buf, size);
383
5.50M
        MemoryAllocator::free(buf);
384
5.50M
    }
385
5.50M
    release_memory(size);
386
5.50M
}
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
14
               check_and_tracking_memory>::free(void* buf, size_t size) const {
377
14
    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
14
    } else {
382
14
        remove_address_sanitizers(buf, size);
383
14
        MemoryAllocator::free(buf);
384
14
    }
385
14
    release_memory(size);
386
14
}
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
7.59k
               check_and_tracking_memory>::free(void* buf, size_t size) const {
377
7.59k
    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
7.59k
    } else {
382
7.59k
        remove_address_sanitizers(buf, size);
383
7.59k
        MemoryAllocator::free(buf);
384
7.59k
    }
385
7.59k
    release_memory(size);
386
7.59k
}
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
540k
                                                    size_t alignment) {
393
540k
    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
540k
    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
540k
    consume_memory(new_size);
405
406
540k
    if (!use_mmap ||
407
540k
        (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold &&
408
540k
         alignment <= MALLOC_MIN_ALIGNMENT)) {
409
540k
        remove_address_sanitizers(buf, old_size);
410
        /// Resize malloc'd memory region with no special alignment requirement.
411
540k
        void* new_buf = MemoryAllocator::realloc(buf, new_size);
412
540k
        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
540k
        add_address_sanitizers(new_buf, new_size);
419
420
540k
        buf = new_buf;
421
540k
        release_memory(old_size);
422
540k
        if constexpr (clear_memory) {
423
276
            if (new_size > old_size) {
424
276
                memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size);
425
276
            }
426
276
        }
427
18.4E
    } else if (old_size >= doris::config::mmap_threshold &&
428
18.4E
               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
18.4E
    } else {
450
        // Big allocs that requires a copy.
451
18.4E
        void* new_buf = alloc(new_size, alignment);
452
18.4E
        memcpy(new_buf, buf, std::min(old_size, new_size));
453
18.4E
        add_address_sanitizers(new_buf, new_size);
454
18.4E
        remove_address_sanitizers(buf, old_size);
455
18.4E
        free(buf, old_size);
456
18.4E
        buf = new_buf;
457
18.4E
        release_memory(old_size);
458
18.4E
    }
459
460
540k
    return buf;
461
540k
}
_ZN5doris9AllocatorILb1ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm
Line
Count
Source
392
4
                                                    size_t alignment) {
393
4
    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
4
    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
4
    consume_memory(new_size);
405
406
4
    if (!use_mmap ||
407
4
        (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold &&
408
4
         alignment <= MALLOC_MIN_ALIGNMENT)) {
409
4
        remove_address_sanitizers(buf, old_size);
410
        /// Resize malloc'd memory region with no special alignment requirement.
411
4
        void* new_buf = MemoryAllocator::realloc(buf, new_size);
412
4
        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
4
        add_address_sanitizers(new_buf, new_size);
419
420
4
        buf = new_buf;
421
4
        release_memory(old_size);
422
4
        if constexpr (clear_memory) {
423
4
            if (new_size > old_size) {
424
4
                memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size);
425
4
            }
426
4
        }
427
4
    } 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
4
    return buf;
461
4
}
_ZN5doris9AllocatorILb1ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm
Line
Count
Source
392
264
                                                    size_t alignment) {
393
264
    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
264
    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
264
    consume_memory(new_size);
405
406
264
    if (!use_mmap ||
407
264
        (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold &&
408
264
         alignment <= MALLOC_MIN_ALIGNMENT)) {
409
264
        remove_address_sanitizers(buf, old_size);
410
        /// Resize malloc'd memory region with no special alignment requirement.
411
264
        void* new_buf = MemoryAllocator::realloc(buf, new_size);
412
264
        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
264
        add_address_sanitizers(new_buf, new_size);
419
420
264
        buf = new_buf;
421
264
        release_memory(old_size);
422
264
        if constexpr (clear_memory) {
423
264
            if (new_size > old_size) {
424
264
                memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size);
425
264
            }
426
264
        }
427
264
    } 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
264
    return buf;
461
264
}
_ZN5doris9AllocatorILb1ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm
Line
Count
Source
392
4
                                                    size_t alignment) {
393
4
    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
4
    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
4
    consume_memory(new_size);
405
406
4
    if (!use_mmap ||
407
4
        (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold &&
408
4
         alignment <= MALLOC_MIN_ALIGNMENT)) {
409
4
        remove_address_sanitizers(buf, old_size);
410
        /// Resize malloc'd memory region with no special alignment requirement.
411
4
        void* new_buf = MemoryAllocator::realloc(buf, new_size);
412
4
        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
4
        add_address_sanitizers(new_buf, new_size);
419
420
4
        buf = new_buf;
421
4
        release_memory(old_size);
422
4
        if constexpr (clear_memory) {
423
4
            if (new_size > old_size) {
424
4
                memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size);
425
4
            }
426
4
        }
427
4
    } 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
4
    return buf;
461
4
}
_ZN5doris9AllocatorILb1ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm
Line
Count
Source
392
4
                                                    size_t alignment) {
393
4
    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
4
    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
4
    consume_memory(new_size);
405
406
4
    if (!use_mmap ||
407
4
        (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold &&
408
4
         alignment <= MALLOC_MIN_ALIGNMENT)) {
409
4
        remove_address_sanitizers(buf, old_size);
410
        /// Resize malloc'd memory region with no special alignment requirement.
411
4
        void* new_buf = MemoryAllocator::realloc(buf, new_size);
412
4
        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
4
        add_address_sanitizers(new_buf, new_size);
419
420
4
        buf = new_buf;
421
4
        release_memory(old_size);
422
4
        if constexpr (clear_memory) {
423
4
            if (new_size > old_size) {
424
4
                memset(reinterpret_cast<char*>(buf) + old_size, 0, new_size - old_size);
425
4
            }
426
4
        }
427
4
    } 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
4
    return buf;
461
4
}
_ZN5doris9AllocatorILb0ELb1ELb1ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm
Line
Count
Source
392
4
                                                    size_t alignment) {
393
4
    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
4
    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
4
    consume_memory(new_size);
405
406
4
    if (!use_mmap ||
407
4
        (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold &&
408
4
         alignment <= MALLOC_MIN_ALIGNMENT)) {
409
4
        remove_address_sanitizers(buf, old_size);
410
        /// Resize malloc'd memory region with no special alignment requirement.
411
4
        void* new_buf = MemoryAllocator::realloc(buf, new_size);
412
4
        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
4
        add_address_sanitizers(new_buf, new_size);
419
420
4
        buf = new_buf;
421
4
        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
4
    } 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
4
    return buf;
461
4
}
_ZN5doris9AllocatorILb0ELb1ELb0ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm
Line
Count
Source
392
4
                                                    size_t alignment) {
393
4
    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
4
    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
4
    consume_memory(new_size);
405
406
4
    if (!use_mmap ||
407
4
        (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold &&
408
4
         alignment <= MALLOC_MIN_ALIGNMENT)) {
409
4
        remove_address_sanitizers(buf, old_size);
410
        /// Resize malloc'd memory region with no special alignment requirement.
411
4
        void* new_buf = MemoryAllocator::realloc(buf, new_size);
412
4
        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
4
        add_address_sanitizers(new_buf, new_size);
419
420
4
        buf = new_buf;
421
4
        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
4
    } 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
4
    return buf;
461
4
}
_ZN5doris9AllocatorILb0ELb0ELb1ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm
Line
Count
Source
392
4
                                                    size_t alignment) {
393
4
    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
4
    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
4
    consume_memory(new_size);
405
406
4
    if (!use_mmap ||
407
4
        (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold &&
408
4
         alignment <= MALLOC_MIN_ALIGNMENT)) {
409
4
        remove_address_sanitizers(buf, old_size);
410
        /// Resize malloc'd memory region with no special alignment requirement.
411
4
        void* new_buf = MemoryAllocator::realloc(buf, new_size);
412
4
        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
4
        add_address_sanitizers(new_buf, new_size);
419
420
4
        buf = new_buf;
421
4
        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
4
    } 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
4
    return buf;
461
4
}
_ZN5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EE7reallocEPvmmm
Line
Count
Source
392
539k
                                                    size_t alignment) {
393
539k
    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
539k
    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
539k
    consume_memory(new_size);
405
406
539k
    if (!use_mmap ||
407
539k
        (old_size < doris::config::mmap_threshold && new_size < doris::config::mmap_threshold &&
408
539k
         alignment <= MALLOC_MIN_ALIGNMENT)) {
409
539k
        remove_address_sanitizers(buf, old_size);
410
        /// Resize malloc'd memory region with no special alignment requirement.
411
539k
        void* new_buf = MemoryAllocator::realloc(buf, new_size);
412
539k
        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
539k
        add_address_sanitizers(new_buf, new_size);
419
420
539k
        buf = new_buf;
421
539k
        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
18.4E
    } else if (old_size >= doris::config::mmap_threshold &&
428
18.4E
               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
18.4E
    } else {
450
        // Big allocs that requires a copy.
451
18.4E
        void* new_buf = alloc(new_size, alignment);
452
18.4E
        memcpy(new_buf, buf, std::min(old_size, new_size));
453
18.4E
        add_address_sanitizers(new_buf, new_size);
454
18.4E
        remove_address_sanitizers(buf, old_size);
455
18.4E
        free(buf, old_size);
456
18.4E
        buf = new_buf;
457
18.4E
        release_memory(old_size);
458
18.4E
    }
459
460
539k
    return buf;
461
539k
}
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
Unexecuted instantiation: _ZN5doris9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EE7reallocEPvmmm
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