[Ns-developers] [NS-Developers] Bug in ErlangRandomVariable class?
Giuseppe Barba
giuseppe.barba at gmail.com
Thu Jul 17 02:02:34 PDT 2008
Hi all.
I'm building up some simulations concerning inter-vehicular communications,
using latest NS release (2.33).
For that reason, I'm using the Nakagami channel model.
Well, I fear I discovered a potentially very dangerous bug that would easily
eat up memory for quite complex/long simulations.
In details.
Nakagami uses the Erlang Random Variable (see line 183 in nakagami.cc).
Giving a look at the Erlang Random Variable definition and, precisely, at
ErlangRandomVariable::value() method (line 174 in ranvar.cc), you can see
that an Exponential Random variable is allocated, but never freed!
I think it's a bug. How about you?
Moreover, given that Erlang's parameter Lambda (used in the allocation of
the aforementioned Exponential ran.var.) is set in the constructor and can
never be changed, is it worth (for avoiding useless alloc/dealloc couples,
that somehow affect performance) putting such allocation in the Erlang's
constructor (clearly adding to the Erlang class a new data member, i.e. the
pointer to the exponential ran.var.)?
Cheers
Giuseppe
More information about the Ns-developers
mailing list