Skip to content

Commit

Permalink
5
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz authored and yiguolei committed Sep 15, 2024
1 parent 3de0ae1 commit 074c450
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion be/src/runtime/exec_env_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ void ExecEnv::init_mem_tracker() {
MemTrackerLimiter::create_shared(MemTrackerLimiter::Type::GLOBAL, "PointQueryExecutor");
_query_cache_mem_tracker =
MemTrackerLimiter::create_shared(MemTrackerLimiter::Type::GLOBAL, "QueryCache");
_block_compression_mem_tracker = _block_compression_mem_tracker =
_block_compression_mem_tracker =
MemTrackerLimiter::create_shared(MemTrackerLimiter::Type::GLOBAL, "BlockCompression");
_rowid_storage_reader_tracker =
MemTrackerLimiter::create_shared(MemTrackerLimiter::Type::GLOBAL, "RowIdStorageReader");
Expand Down
2 changes: 1 addition & 1 deletion be/src/runtime/memory/lru_cache_policy.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class LRUCachePolicy : public CachePolicy {
if (value != nullptr) {
mem_tracker()->consume(tracking_bytes_with_handle);
((LRUCacheValueBase*)value)
->set_tracking_bytes(tracking_bytes_with_handle, _mem_tracker.get());
->set_tracking_bytes(tracking_bytes_with_handle, _mem_tracker);
}
return _cache->insert(key, value, charge, priority);
}
Expand Down
5 changes: 3 additions & 2 deletions be/src/runtime/memory/lru_cache_value_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@ class LRUCacheValueBase {
}
}

void set_tracking_bytes(size_t tracking_bytes, MemTrackerLimiter* mem_tracker) {
void set_tracking_bytes(size_t tracking_bytes,
const std::shared_ptr<MemTrackerLimiter>& mem_tracker) {
this->_tracking_bytes = tracking_bytes;
this->_mem_tracker = mem_tracker;
}

protected:
size_t _tracking_bytes = 0;
MemTrackerLimiter* _mem_tracker = nullptr;
std::shared_ptr<MemTrackerLimiter> _mem_tracker;
};

} // namespace doris

0 comments on commit 074c450

Please sign in to comment.