[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.
This commit is contained in:
zhannngchen
2024-06-17 20:41:38 +08:00
committed by GitHub
parent e68834158c
commit 3810861bb1

View File

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