jkhaliqi commented on code in PR #8470:
URL: https://github.com/apache/incubator-gluten/pull/8470#discussion_r1907918648
##########
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:
cpp/velox/memory/[VeloxMemoryManager.cc:275](http://veloxmemorymanager.cc:275/)
Use of Uninitialized
Variable@cpp/velox/memory/[VeloxMemoryManager.cc:281](http://veloxmemorymanager.cc:281/)
Use of Uninitialized
Variable@cpp/velox/memory/[VeloxMemoryManager.cc:279](http://veloxmemorymanager.cc:279/)
Use of Uninitialized
Variable@cpp/velox/memory/[VeloxMemoryManager.cc:277](http://veloxmemorymanager.cc:277/)
I was assuming these were failing because we had to check that the pointers
that were being passed in were not nullpointers so did a check for that before
using them?
--
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]