mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-08 01:58:34 +08:00
fix: refund loaded resource usage in Insert/DeleteRecord destructor (#44555)
issue: #44528 Signed-off-by: Shawn Wang <shawn.wang@zilliz.com>
This commit is contained in:
parent
eac16a577c
commit
0145dc8c06
@ -67,8 +67,11 @@ class DeletedRecord {
|
|||||||
|
|
||||||
~DeletedRecord() {
|
~DeletedRecord() {
|
||||||
if constexpr (is_sealed) {
|
if constexpr (is_sealed) {
|
||||||
cachinglayer::Manager::GetInstance().RefundLoadedResource(
|
if (estimated_memory_size_ > 0) {
|
||||||
{estimated_memory_size_, 0});
|
cachinglayer::Manager::GetInstance().RefundLoadedResource(
|
||||||
|
{estimated_memory_size_, 0});
|
||||||
|
estimated_memory_size_ = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -461,6 +461,14 @@ class InsertRecordSealed {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
~InsertRecordSealed() {
|
||||||
|
if (estimated_memory_size_ > 0) {
|
||||||
|
cachinglayer::Manager::GetInstance().RefundLoadedResource(
|
||||||
|
{static_cast<int64_t>(estimated_memory_size_), 0});
|
||||||
|
estimated_memory_size_ = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
contain(const PkType& pk) const {
|
contain(const PkType& pk) const {
|
||||||
return pk2offset_->contain(pk);
|
return pk2offset_->contain(pk);
|
||||||
@ -587,9 +595,11 @@ class InsertRecordSealed {
|
|||||||
timestamp_index_ = TimestampIndex();
|
timestamp_index_ = TimestampIndex();
|
||||||
pk2offset_->clear();
|
pk2offset_->clear();
|
||||||
reserved = 0;
|
reserved = 0;
|
||||||
cachinglayer::Manager::GetInstance().RefundLoadedResource(
|
if (estimated_memory_size_ > 0) {
|
||||||
{static_cast<int64_t>(estimated_memory_size_), 0});
|
cachinglayer::Manager::GetInstance().RefundLoadedResource(
|
||||||
estimated_memory_size_ = 0;
|
{static_cast<int64_t>(estimated_memory_size_), 0});
|
||||||
|
estimated_memory_size_ = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user