Skip to content

Commit

Permalink
arch-power: Fix memory leaks from address translation
Browse files Browse the repository at this point in the history
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 <sandipan@linux.ibm.com>
  • Loading branch information
sandip4n committed Apr 24, 2020
1 parent 7266f75 commit cae5353
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/arch/power/radixwalk.cc
Expand Up @@ -78,7 +78,9 @@ RadixWalk::readPhysMem(uint64_t addr, uint64_t dataSize)
this->port.sendAtomic(read);
ret = read->get<uint64_t>();

read->deleteData();
delete read->req;
delete read;

return ret;
}
Expand All @@ -95,7 +97,9 @@ RadixWalk::writePhysMem(uint64_t addr, uint64_t dataSize)
this->port.sendAtomic(write);
ret = write->get<uint64_t>();

write->deleteData();
delete write->req;
delete write;

return ret;
}
Expand Down

0 comments on commit cae5353

Please sign in to comment.