[feature-wip] (memory tracker) (step4) Switch TLS mem tracker to separate more detailed memory usage (#8669)
Based on #8605, Separate out the memory usage of each operator from the Query/Load/StorageEngine mem tracker.
This commit is contained in:
@ -119,13 +119,10 @@ ChunkAllocator::ChunkAllocator(size_t reserve_limit)
|
||||
_arenas(CpuInfo::get_max_num_cores()) {
|
||||
_mem_tracker =
|
||||
MemTracker::create_tracker(-1, "ChunkAllocator", nullptr, MemTrackerLevel::OVERVIEW);
|
||||
SCOPED_SWITCH_THREAD_LOCAL_MEM_TRACKER(_mem_tracker);
|
||||
SCOPED_SWITCH_THREAD_LOCAL_MEM_TRACKER_END_CLEAR(_mem_tracker);
|
||||
for (int i = 0; i < _arenas.size(); ++i) {
|
||||
_arenas[i].reset(new ChunkArena());
|
||||
}
|
||||
// After the ChunkAllocator is created in the main thread, the main thread will not switch to the
|
||||
// chunk allocator mem tracker again, so manually clear the untracked mem in tls.
|
||||
thread_local_ctx.get()->_thread_mem_tracker_mgr->clear_untracked_mems();
|
||||
|
||||
_chunk_allocator_metric_entity =
|
||||
DorisMetrics::instance()->metric_registry()->register_entity("chunk_allocator");
|
||||
|
||||
Reference in New Issue
Block a user