Skip to content

Commit

Permalink
Avoid unnecessary reclaim operation on non-reclaimable query
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxmeng committed May 7, 2024
1 parent 1fd2bc9 commit 92c08ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion velox/common/memory/SharedArbitrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,8 @@ uint64_t SharedArbitrator::reclaim(
uint64_t targetBytes,
bool isLocalArbitration) noexcept {
int64_t bytesToReclaim = std::min<uint64_t>(
std::max(targetBytes, memoryPoolTransferCapacity_), pool->capacity());
std::max(targetBytes, memoryPoolTransferCapacity_),
reclaimableUsedCapacity(*pool));
if (bytesToReclaim == 0) {
return 0;
}
Expand Down

0 comments on commit 92c08ae

Please sign in to comment.