From: Sandipan Das Date: Fri, 24 Apr 2020 06:14:33 +0000 (+0530) Subject: arch-power: Fix memory leaks from address translation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=64191ddc02754adf331582cc48a95b1d396b723f;p=gem5.git 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 --- 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; }