xinyiZzz commented on a change in pull request #8322:
URL: https://github.com/apache/incubator-doris/pull/8322#discussion_r823763889



##########
File path: be/src/runtime/disk_io_mgr.cc
##########
@@ -359,14 +363,14 @@ DiskIoMgr::~DiskIoMgr() {
      */
 }
 
-Status DiskIoMgr::init(const std::shared_ptr<MemTracker>& process_mem_tracker) 
{
-    DCHECK(process_mem_tracker != nullptr);
-    _process_mem_tracker = process_mem_tracker;
+Status DiskIoMgr::init(const int64_t mem_limit) {
+    _mem_tracker->set_limit(mem_limit);
+    _cached_buffers_mem_tracker = MemTracker::create_tracker(
+            mem_limit, "DiskIO:CachedBuffers", _mem_tracker, 
MemTrackerLevel::OVERVIEW);
     // If we hit the process limit, see if we can reclaim some memory by 
removing
     // previously allocated (but unused) io buffers.
-    /*
-     * process_mem_tracker->AddGcFunction(bind(&DiskIoMgr::gc_io_buffers, 
this));
-     */
+    MemTracker::get_process_tracker()->add_gc_function(
+            std::bind<void>(&DiskIoMgr::gc_io_buffers, this, 
std::placeholders::_1));

Review comment:
       I'm not sure, but the gc function was incomplete before, so I've added 
it.
   After clearing the free buffer, how much impact will it have on subsequent 
queries may need to be verified




-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to