zhannngchen commented on code in PR #16987:
URL: https://github.com/apache/doris/pull/16987#discussion_r1113797968


##########
be/src/olap/segment_loader.cpp:
##########
@@ -52,8 +53,15 @@ void SegmentLoader::_insert(const SegmentLoader::CacheKey& 
key, SegmentLoader::C
         delete cache_value;
     };
 
+    int64_t meta_mem_usage = 0;
+    for (auto segment : value.segments) {
+        meta_mem_usage += segment->meta_mem_usage();
+    }
+
     auto lru_handle = _cache->insert(key.encode(), &value, 
sizeof(SegmentLoader::CacheValue),
-                                     deleter, CachePriority::NORMAL);
+                                     deleter, CachePriority::NORMAL, 
meta_mem_usage);
+    LOG(INFO) << "1111111 " << sizeof(SegmentLoader::CacheValue) << ", " << 
meta_mem_usage << ", "

Review Comment:
   111111? 



##########
be/src/util/mem_info.cpp:
##########
@@ -97,6 +98,8 @@ void MemInfo::process_cache_gc(int64_t& freed_mem) {
     freed_mem +=
             
StoragePageCache::instance()->get_page_cache_mem_consumption(segment_v2::DATA_PAGE);
     StoragePageCache::instance()->prune(segment_v2::DATA_PAGE);
+    // TODO add freed_mem
+    SegmentLoader::instance()->prune();

Review Comment:
   Why do we need to call `prune()` here? 



-- 
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