From eb2a67b4eceda53a2de8c14c1cdaff7f14ced2de Mon Sep 17 00:00:00 2001 From: Rui Mo Date: Thu, 4 Dec 2025 21:26:08 +0800 Subject: [PATCH] Wait for reserved bytes --- cpp/velox/memory/VeloxMemoryManager.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/velox/memory/VeloxMemoryManager.cc b/cpp/velox/memory/VeloxMemoryManager.cc index d5c71d78e62..b0c02bf4885 100644 --- a/cpp/velox/memory/VeloxMemoryManager.cc +++ b/cpp/velox/memory/VeloxMemoryManager.cc @@ -377,14 +377,14 @@ void VeloxMemoryManager::hold() { bool VeloxMemoryManager::tryDestructSafe() { // Velox memory pools considered safe to destruct when no alive allocations. for (const auto& pool : heldVeloxPools_) { - if (pool && pool->usedBytes() != 0) { + if (pool && pool->reservedBytes() != 0) { return false; } } - if (veloxLeafPool_ && veloxLeafPool_->usedBytes() != 0) { + if (veloxLeafPool_ && veloxLeafPool_->reservedBytes() != 0) { return false; } - if (veloxAggregatePool_ && veloxAggregatePool_->usedBytes() != 0) { + if (veloxAggregatePool_ && veloxAggregatePool_->reservedBytes() != 0) { return false; } heldVeloxPools_.clear();