BiteTheDDDDt commented on code in PR #22764:
URL: https://github.com/apache/doris/pull/22764#discussion_r1287991737


##########
be/src/util/mem_info.cpp:
##########
@@ -224,22 +224,37 @@ bool MemInfo::process_full_gc() {
 }
 
 int64_t MemInfo::tg_hard_memory_limit_gc() {
+    MonotonicStopWatch watch;
+    watch.start();
     std::vector<taskgroup::TaskGroupPtr> task_groups;
+    std::unique_ptr<RuntimeProfile> tg_profile = 
std::make_unique<RuntimeProfile>("WorkloadGroup");
+    int64_t total_free_memory = 0;
+
+    Defer defer {[&]() {
+        if (total_free_memory > 0) {
+            je_purge_all_arena_dirty_pages();
+            std::stringstream ss;
+            tg_profile->pretty_print(&ss);
+            LOG(INFO) << fmt::format(
+                    "End Task Group Overcommit Memory GC, Free Memory {} 
Bytes. cost(us): {}, "
+                    "details: {}",
+                    total_free_memory, watch.elapsed_time() / 1000, ss.str());

Review Comment:
   maybe we can use PrettyPrinter?



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