From e097d20fea7f1c15233ef7363b260fc5aec8d6b0 Mon Sep 17 00:00:00 2001 From: vsian Date: Tue, 10 Dec 2024 18:06:15 +0800 Subject: [PATCH] fix ivf : after dump, shouldn't call decrease memory usage when destructing --- src/storage/knn_index/knn_ivf/ivf_index_data_in_mem.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/storage/knn_index/knn_ivf/ivf_index_data_in_mem.cpp b/src/storage/knn_index/knn_ivf/ivf_index_data_in_mem.cpp index 40c8353af4..9d7f54eb19 100644 --- a/src/storage/knn_index/knn_ivf/ivf_index_data_in_mem.cpp +++ b/src/storage/knn_index/knn_ivf/ivf_index_data_in_mem.cpp @@ -110,7 +110,11 @@ class IVFIndexInMemT final : public IVFIndexInMem { } } - ~IVFIndexInMemT() { BaseMemIndex::DecreaseMemoryUsage(MemoryUsed()); } + ~IVFIndexInMemT() { + if (own_ivf_index_storage_) { + BaseMemIndex::DecreaseMemoryUsage(MemoryUsed()); + } + } MemIndexTracerInfo GetInfo() const override { auto *table_index_entry = segment_index_entry_->table_index_entry();