xinyiZzz commented on code in PR #49147:
URL: https://github.com/apache/doris/pull/49147#discussion_r2013469222


##########
be/src/olap/metadata_adder.h:
##########
@@ -168,6 +175,13 @@ MetadataAdder<T>::MetadataAdder(const MetadataAdder<T>& 
other) {
     add_mem_size(this->_current_meta_size);
 }
 
+template <typename T>
+MetadataAdder<T>::MetadataAdder(MetadataAdder&& other) {
+    this->_current_meta_size = other._current_meta_size;
+    add_num(1);
+    add_mem_size(this->_current_meta_size);

Review Comment:
   change to:
   ```
   this->_current_meta_size = sizeof(T)
   add_num(1);
   add_mem_size(sizeof(T));
   ```
   既然问题是 class 拷贝构造时,其内部的 pb 不确定有没有拷贝,
   那我们假定当 class 拷贝构造时,其内部的 pb 都没有发生拷贝,即 pb 只在主动构造的时候统计一次
   这样虽然预期统计的比实际值少,但至少统计了一部分pb



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