diff --git a/hipamd/src/hip_mempool_impl.cpp b/hipamd/src/hip_mempool_impl.cpp index afdc35e3eb..230c60ea50 100644 --- a/hipamd/src/hip_mempool_impl.cpp +++ b/hipamd/src/hip_mempool_impl.cpp @@ -86,8 +86,8 @@ bool Heap::RemoveMemory(amd::Memory* memory, MemoryTimestamp* ts) { std::unordered_map::iterator Heap::EraseAllocaton(std::unordered_map::iterator& it) { const device::Memory* dev_mem = it->first->getDeviceMemory(*device_->devices()[0]); - amd::SvmBuffer::free(it->first->getContext(), reinterpret_cast(dev_mem->virtualAddress())); total_size_ -= it->first->getSize(); + amd::SvmBuffer::free(it->first->getContext(), reinterpret_cast(dev_mem->virtualAddress())); // Clear HIP event it->second.SetEvent(nullptr); // Remove the allocation from the map