zhztheplayer commented on code in PR #8470:
URL: https://github.com/apache/incubator-gluten/pull/8470#discussion_r1910364585
##########
cpp/velox/memory/VeloxMemoryManager.cc:
##########
@@ -265,20 +272,25 @@ MemoryUsageStats collectVeloxMemoryUsageStats(const
velox::memory::MemoryPool* p
}
MemoryUsageStats collectGlutenAllocatorMemoryUsageStats(const MemoryAllocator*
allocator) {
- MemoryUsageStats stats;
+ MemoryUsageStats stats{};
stats.set_current(allocator->getBytes());
stats.set_peak(allocator->peakBytes());
return stats;
}
int64_t shrinkVeloxMemoryPool(velox::memory::MemoryManager* mm,
velox::memory::MemoryPool* pool, int64_t size) {
- std::string poolName{pool->root()->name() + "/" + pool->name()};
- std::string logPrefix{"Shrink[" + poolName + "]: "};
- VLOG(2) << logPrefix << "Trying to shrink " << size << " bytes of data...";
- VLOG(2) << logPrefix << "Pool has reserved " << pool->usedBytes() << "/" <<
pool->root()->reservedBytes() << "/"
- << pool->root()->capacity() << "/" << pool->root()->maxCapacity() <<
" bytes.";
- VLOG(2) << logPrefix << "Shrinking...";
- auto shrunken = mm->arbitrator()->shrinkCapacity(pool, 0);
+ if (pool != nullptr) {
Review Comment:
Ditto. Can we throw exception when `pool == nullptr`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]