github-actions[bot] commented on code in PR #33175:
URL: https://github.com/apache/doris/pull/33175#discussion_r1547726626


##########
be/src/runtime/memory/mem_tracker_limiter.h:
##########
@@ -131,6 +131,41 @@ class MemTrackerLimiter final : public MemTracker {
 
     static bool sys_mem_exceed_limit_check(int64_t bytes);
 
+    void consume(int64_t bytes) {

Review Comment:
   warning: method 'consume' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
       static void consume(int64_t bytes) {
   ```
   



##########
be/src/runtime/memory/mem_tracker_limiter.h:
##########
@@ -131,6 +131,41 @@
 
     static bool sys_mem_exceed_limit_check(int64_t bytes);
 
+    void consume(int64_t bytes) {
+        if (UNLIKELY(bytes == 0)) {
+            return;
+        }
+        _consumption->add(bytes);
+        if (_consumption->current_value() < 0 && _type == Type::QUERY) {
+            LOG(FATAL) << "test_no_equal_0_query consume, mem tracker label: " 
<< _label
+                       << ", consumption: " << _consumption->current_value()
+                       << ", peak consumption: " << _consumption->peak_value();
+        }
+
+        if (_query_statistics) {
+            
_query_statistics->set_max_peak_memory_bytes(_consumption->peak_value());
+            
_query_statistics->set_current_used_memory_bytes(_consumption->current_value());
+        }
+    }
+
+    void consume_no_update_peak(int64_t bytes) { // need extreme fast

Review Comment:
   warning: method 'consume_no_update_peak' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
       static void consume_no_update_peak(int64_t bytes) { // need extreme fast
   ```
   



##########
be/src/runtime/memory/mem_tracker_limiter.h:
##########
@@ -131,6 +131,41 @@
 
     static bool sys_mem_exceed_limit_check(int64_t bytes);
 
+    void consume(int64_t bytes) {
+        if (UNLIKELY(bytes == 0)) {
+            return;
+        }
+        _consumption->add(bytes);
+        if (_consumption->current_value() < 0 && _type == Type::QUERY) {
+            LOG(FATAL) << "test_no_equal_0_query consume, mem tracker label: " 
<< _label
+                       << ", consumption: " << _consumption->current_value()
+                       << ", peak consumption: " << _consumption->peak_value();
+        }
+
+        if (_query_statistics) {
+            
_query_statistics->set_max_peak_memory_bytes(_consumption->peak_value());
+            
_query_statistics->set_current_used_memory_bytes(_consumption->current_value());
+        }
+    }
+
+    void consume_no_update_peak(int64_t bytes) { // need extreme fast
+        _consumption->add_no_update_peak(bytes);
+        if (_consumption->current_value() < 0 && _type == Type::QUERY) {
+            LOG(FATAL) << "test_no_equal_0_query consume_no_update_peak, mem 
tracker label: "
+                       << _label << ", consumption: " << 
_consumption->current_value()
+                       << ", peak consumption: " << _consumption->peak_value();
+        }
+    }
+
+    void release(int64_t bytes) {

Review Comment:
   warning: method 'release' can be made static 
[readability-convert-member-functions-to-static]
   
   ```suggestion
       static void release(int64_t bytes) {
   ```
   



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

Reply via email to