This is an automated email from the ASF dual-hosted git repository.

zhangchen pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 3810861bb13 [branch-2.1](cherry-pick) add _pk_index_meta's size to 
Segment::_meta_mem_usage (#36329) (#36399)
3810861bb13 is described below

commit 3810861bb1328112772dfdd607a6abd2ca2f2c90
Author: zhannngchen <48427519+zhannngc...@users.noreply.github.com>
AuthorDate: Mon Jun 17 20:41:38 2024 +0800

    [branch-2.1](cherry-pick) add _pk_index_meta's size to 
Segment::_meta_mem_usage (#36329) (#36399)
    
    cherry-pick #36329
    
    add _pk_index_meta's size to Segment::_meta_mem_usage to make memory
    estimation more accurate.
---
 be/src/olap/rowset/segment_v2/segment.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/be/src/olap/rowset/segment_v2/segment.cpp 
b/be/src/olap/rowset/segment_v2/segment.cpp
index e121639ac9e..f2ec504c90f 100644
--- a/be/src/olap/rowset/segment_v2/segment.cpp
+++ b/be/src/olap/rowset/segment_v2/segment.cpp
@@ -116,6 +116,9 @@ Status Segment::_open() {
 
     // An estimated memory usage of a segment
     _meta_mem_usage += _footer_pb->ByteSizeLong();
+    if (_pk_index_meta != nullptr) {
+        _meta_mem_usage += _pk_index_meta->ByteSizeLong();
+    }
     _meta_mem_usage += sizeof(*this);
     _meta_mem_usage += _tablet_schema->num_columns() * 
config::estimated_mem_per_column_reader;
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to