[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] deleting simulator instance cleanly
In a small scale parameter determining run I repeat the same simulation over and over
again with different parameters; at the moment at the end of each run I do a delete $ns
and delete any objects which I have deliberately created with new. This still leaves
a huge memory leak; I suspect this is due to Tcl's lack of GC so all of the objects created
inside the Simulator instance are not deleted. So for example nodes created with
set nodex [$ns node]
aren't deleted. For longer simulations I use a perl script which finds spare machines
and runs the simulations independently, but this is a very nasty solution for simple
quick simulations.
Is there a tidy way for the simulator instance to delete all of it's junk, or even simply
to reset it's clock to zero (the same topology etc is used on all of the runs). Looking
at the code it seens that $ns run will do this provided I'm careful and I add some suitable
code to scheduler.cc which empties out the scheduler. Is this correct?
Alan Bain