MCPcopy Create free account
hub / github.com/apache/impala / FreeAll

Method FreeAll

be/src/runtime/mem-pool.cc:76–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void MemPool::FreeAll() {
77 DFAKE_SCOPED_LOCK(mutex_);
78 int64_t total_bytes_released = 0;
79 MonotonicStopWatch sw;
80 sw.Start();
81 for (auto& chunk: chunks_) {
82 total_bytes_released += chunk.size;
83 free(chunk.data);
84 counters_.sys_free_duration.UpdateCounter(sw.Reset());
85 counters_.freed_bytes.UpdateCounter(chunk.size);
86 }
87 chunks_.clear();
88 next_chunk_size_ = INITIAL_CHUNK_SIZE;
89 current_chunk_idx_ = -1;
90 total_allocated_bytes_ = 0;
91 total_reserved_bytes_ = 0;
92
93 mem_tracker_->Release(total_bytes_released);
94}
95
96bool MemPool::FindChunk(int64_t min_size, bool check_limits) noexcept {
97 // Try to allocate from a free chunk. We may have free chunks after the current chunk

Callers 15

CallAiGenerateTextFunction · 0.45
AcquireDataMethod · 0.45
CloseMethod · 0.45
CloseMethod · 0.45
TESTFunction · 0.45
TearDownMethod · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
~RowBatchMethod · 0.45
ResetMethod · 0.45
TearDownMethod · 0.45

Calls 5

clearMethod · 0.65
StartMethod · 0.45
UpdateCounterMethod · 0.45
ResetMethod · 0.45
ReleaseMethod · 0.45

Tested by 11

TESTFunction · 0.36
TearDownMethod · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TearDownMethod · 0.36
TEST_FFunction · 0.36
TESTFunction · 0.36
TearDownMethod · 0.36
ValidateDictFunction · 0.36
~DecompressorTestMethod · 0.36
TEST_FFunction · 0.36