From 64191ddc02754adf331582cc48a95b1d396b723f Mon Sep 17 00:00:00 2001 From: Sandipan Das Date: Fri, 24 Apr 2020 11:44:33 +0530 Subject: [PATCH] arch-power: Fix memory leaks from address translation While performing address translation using the radix tree walk mechanism, the objects corresponding to the read and write requests must be freed properly. These contain data buffers which if not freed, will keep increasing memory usage and cause the simulator to get OOM-killed quite early on low-memory systems. Change-Id: I0bc87bd8950e83829d68ba51e64d81eabf20fa6b Signed-off-by: Sandipan Das --- src/arch/power/radixwalk.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/arch/power/radixwalk.cc b/src/arch/power/radixwalk.cc index a0e88ed2e..597ca262f 100644 --- a/src/arch/power/radixwalk.cc +++ b/src/arch/power/radixwalk.cc @@ -78,7 +78,9 @@ RadixWalk::readPhysMem(uint64_t addr, uint64_t dataSize) this->port.sendAtomic(read); ret = read->get(); + read->deleteData(); delete read->req; + delete read; return ret; } @@ -95,7 +97,9 @@ RadixWalk::writePhysMem(uint64_t addr, uint64_t dataSize) this->port.sendAtomic(write); ret = write->get(); + write->deleteData(); delete write->req; + delete write; return ret; } -- 2.30.2