MCPcopy Create free account
hub / github.com/antgroup/vsag / cal_memory_usage

Method cal_memory_usage

src/algorithm/ivf.cpp:1146–1161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1144}
1145
1146void
1147IVF::cal_memory_usage() {
1148 auto memory = sizeof(IVF);
1149 memory += this->bucket_->GetMemoryUsage();
1150 if (use_reorder_) {
1151 memory += this->reorder_codes_->GetMemoryUsage();
1152 }
1153 if (this->extra_info_size_ > 0 and this->extra_infos_ != nullptr) {
1154 memory += this->extra_infos_->GetMemoryUsage();
1155 }
1156 memory += this->label_table_->GetMemoryUsage();
1157 memory += location_map_.size() * sizeof(uint64_t);
1158 memory += partition_strategy_->GetMemoryUsage();
1159 std::unique_lock lock(this->memory_usage_mutex_);
1160 this->current_memory_usage_.store(static_cast<int64_t>(memory));
1161}
1162
1163int64_t
1164IVF::GetMemoryUsage() const {

Callers 2

AddMethod · 0.95
DeserializeMethod · 0.95

Calls 3

storeMethod · 0.80
GetMemoryUsageMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected