Skip to content

Commit

Permalink
Only add shared column data size to root_of_query_mem_trackers. (#8137)
Browse files Browse the repository at this point in the history
ref #8128
  • Loading branch information
JinheLin authored Sep 25, 2023
1 parent a7cdb82 commit 7989a61
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dbms/src/Common/MemoryTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ void MemoryTracker::alloc(Int64 size, bool check_memory_limit)
if (!next.load(std::memory_order_relaxed))
{
CurrentMetrics::add(metric, size);
if (shared_column_data_mem_tracker)
will_be += shared_column_data_mem_tracker->get(); // Add shared column data size to root tracker.
// Only add shared column data size to root_of_query_mem_trackers.
if (shared_column_data_mem_tracker && root_of_query_mem_trackers.get() == this)
will_be += shared_column_data_mem_tracker->get();
}

if (check_memory_limit)
Expand Down

0 comments on commit 7989a61

Please sign in to comment.