xinyiZzz commented on code in PR #9145:
URL: https://github.com/apache/incubator-doris/pull/9145#discussion_r857133901
##########
be/src/runtime/thread_mem_tracker_mgr.h:
##########
@@ -175,39 +170,70 @@ class ThreadMemTrackerMgr {
ConsumeErrCallBackInfo _consume_err_cb;
};
+inline void ThreadMemTrackerMgr::init() {
+ _tracker_id = 0;
+ _mem_trackers.clear();
+ _mem_trackers[0] = MemTracker::get_process_tracker();
+ _untracked_mems.clear();
+ _untracked_mems[0] = 0;
+ _mem_tracker_labels.clear();
+ _mem_tracker_labels[0] = MemTracker::get_process_tracker()->label();
+}
+
+inline void ThreadMemTrackerMgr::init_bthread() {
+ init();
+ _mem_trackers[1] = MemTracker::get_brpc_server_tracker();
+ _untracked_mems[1] = 0;
Review Comment:
Safe because the map key is the tracker id
id = (GetCurrentTimeMicros() % 1000000) * 100 + _label.length()
(Actually, I'm not 100% sure if the id could be duplicated... but it should
be faster than converting to int after hash)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]