Skip to content

Commit 5897d34

Browse files
authored
[VL] Minor: No need toobtain old shrunk memory (apache#6847)
1 parent 4dcfa86 commit 5897d34

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cpp/velox/memory/VeloxMemoryManager.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,7 @@ int64_t shrinkVeloxMemoryPool(velox::memory::MemoryManager* mm, velox::memory::M
252252
VLOG(2) << logPrefix << "Pool has reserved " << pool->usedBytes() << "/" << pool->root()->reservedBytes() << "/"
253253
<< pool->root()->capacity() << "/" << pool->root()->maxCapacity() << " bytes.";
254254
VLOG(2) << logPrefix << "Shrinking...";
255-
const uint64_t oldCapacity = pool->capacity();
256-
mm->arbitrator()->shrinkCapacity(pool, 0);
257-
const uint64_t newCapacity = pool->capacity();
258-
int64_t shrunken = oldCapacity - newCapacity;
255+
auto shrunken = mm->arbitrator()->shrinkCapacity(pool, 0);
259256
VLOG(2) << logPrefix << shrunken << " bytes released from shrinking.";
260257
return shrunken;
261258
}

0 commit comments

Comments
 (0)