wangbo commented on code in PR #19802: URL: https://github.com/apache/doris/pull/19802#discussion_r1198723250
########## be/src/util/mem_info.cpp: ########## @@ -215,6 +221,52 @@ bool MemInfo::process_full_gc() { return false; } +int64_t MemInfo::tg_hard_memory_limit_gc() { + std::vector<taskgroup::TaskGroupPtr> task_groups; + taskgroup::TaskGroupManager::instance()->get_resource_groups( + [](const taskgroup::TaskGroupPtr& task_group) { + return !task_group->enable_overcommit(); + }, + &task_groups); + + int64_t total_free_memory = 0; + for (const auto& task_group : task_groups) { + total_free_memory += task_group->memory_limit_gc(); + } + return total_free_memory; Review Comment: ``` [memory_limit, name, used] list; for (const auto& task_group : task_groups) { list->add(task_group->get_info()); } MemTrackerLimiter::tg_memory_limit_gc(list); ``` 1 get needed info from TaskGroup; 2 call tg_memory_limit_gc in mem_info; Maybe it's more clear; -- 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