| 1144 | } |
| 1145 | |
| 1146 | void |
| 1147 | IVF::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 | |
| 1163 | int64_t |
| 1164 | IVF::GetMemoryUsage() const { |
no test coverage detected