I'm using NS-3 with Python Bindings. I've a function, say network_step(), that runs an NS-3 scenario, and it ends with ns.Simulator.Destroy(). network_step() is called from main in a loop. I find that memory consumption keeps on increasing while progressing through the loop. I don't understand why this happens. I thought that ending each NS-3 run with ns.Simulator.Destroy() would release all the memory associated with that run. Please let me know if you've any insight on why this happens, and how to remedy it. Thanks!
Just to be clear, my set up is as follows:
N = 100000
for i in range(N):
network_step()
def network_step():
....
Python script for an NS-3 scenario
....
ns.Simulator.Stop(ns.core.Seconds(simTime))
ns.Simulator.Run()
ns.Simulator.Destroy()