Skip to content

Commit

Permalink
13
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Sep 28, 2024
1 parent 1b8a421 commit 3bf659f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions be/src/olap/rowset/segcompaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@
namespace doris {
using namespace ErrorCode;

std::atomic<long> seg_compaction_counter(0);

SegcompactionWorker::SegcompactionWorker(BetaRowsetWriter* writer) : _writer(writer) {}

void SegcompactionWorker::init_mem_tracker(int64_t txn_id, PUniqueId load_id) {
_seg_compact_mem_tracker = MemTrackerLimiter::create_shared(
MemTrackerLimiter::Type::COMPACTION,
fmt::format("segcompaction-txnID_{}-loadID_{}_{}", std::to_string(txn_id),
print_id(load_id), seg_compaction_counter.fetch_add(1)));
fmt::format("segcompaction-txnID_{}-loadID_{}", std::to_string(txn_id),
print_id(load_id)));
}

Status SegcompactionWorker::_get_segcompaction_reader(
Expand Down
4 changes: 3 additions & 1 deletion be/src/runtime/memory/mem_tracker_limiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace doris {

static bvar::Adder<int64_t> memory_memtrackerlimiter_cnt("memory_memtrackerlimiter_cnt");

std::atomic<long> mem_tracker_number_counter(0);
std::atomic<long> mem_tracker_limiter_group_counter(0);
constexpr auto GC_MAX_SEEK_TRACKER = 1000;

Expand All @@ -61,7 +62,8 @@ static RuntimeProfile::Counter* previously_canceling_tasks_counter =
MemTrackerLimiter::MemTrackerLimiter(Type type, const std::string& label, int64_t byte_limit) {
DCHECK_GE(byte_limit, -1);
_type = type;
_label = label;
// MemTrackerLimiter labels cannot be repeated, otherwise generation Runtime Profile will fail.
_label = fmt::format("{}_{}", label, mem_tracker_number_counter.fetch_add(1));
_limit = byte_limit;
if (_type == Type::GLOBAL) {
_group_num = 0;
Expand Down

0 comments on commit 3bf659f

Please sign in to comment.