[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns2] Memory leak?



Hi Kannan

> Hi Chris,
> 
> 
> > I've noticed a memory leak in ns-2.0b18 while monitoring memory usage
with
> > ps. It's ca. 500kB/min in my simulation. Also, I once got a core dump
with
> > 16MB, when my simulation crashed (due to insufficient memory? I checked
the
> > virtual memory and it was pretty exhausted at the time of the crash).
> > 
> > I use only Agent/TCP objects (ca. 150) with FTP as the traffic-source
and
> > SRM-agents. My scheduler is HEAP.
> > 
> > Has somebody got any suggestions where the leak comes from?
> 


> To the best of my knowledge, there are no memory leaks in my
> version of SRM, and I suspect, very few in TCP :-)  I wanted to
> check with some quick simulations before I answered; hence the
> delay in my responding.
> 

> I expect you are using the stock SRM agent in the distribution,
> with possibly minor mods?  You had mentioned at least 200 nodes
> in your simulation in an earlier note.
> 
> 	( If you are using the DV routing in the simulator, then
> 	there is a bug in memory allocation that I found after
> 	reading your note.  I am not sure if you are using
> 	dynamic routing though.  The fix for this is trivial,
> 	and will get into the current distrib later this week. )
> 
> The implementation is not optimised for memory yet (by design).
> Each agent spins off a separate SRM/foo object to handle error
> recovery for each loss, where foo is either request or repair.
> The memory used by these objects is released by an agent, as
> soon as its error recovery phase for that loss is complete.
> But, if your loss rate is high, there can be issues in scaling.
> So, questions:
> 
> 	1.  How many sources?  What data rate?	2.  Do all the
> 	group members come on at the same time?  Or do
> 	    they come at different intervals?
> 	3.  Most importantly, what is your loss rate, and what
> 	is the
> 	    max. number of simultaneous loss you see?
> 
> 
> 
> Kannan



thanks for your help. I found out a little more: I had some more test in a
scenario with just 200 TCP connections and figured out that memory
utilization remains constant even over "long" periods (100s), thus there is
no prob with them.

Also no problem is SRM (at least if no packet losses occur), I have figure
that out still.

The problem comes with the prunes. I observed that prunes slow down the
simulator terribly and that memory utilization increases (ca. 15kB/s)
exactly at the times when they are sent.
That even need not necessarily be a bug, as routers have to keep a
(src,group)-entry for every pruned packet they see, so if they see many
prunes from many SRM-senders, they have probably large tables. My
test-network was 126 nodes with 50 SRM-agents (nothing else) and ran out of
memory within some few minutes. SRM-rate was 512kbps, network was "good"
enough to handle that traffic without packet loss. All group-members join
at 0.0, only one joins 4s later (he acts as the sender of user data like in
1:n-multicast, although the other send session messages as well).
PruneTimeout was set from 0.5s to some value >1000s so that I saw many
prunes within the first 2 seconds and then not until second 4.

I didn't modify any file that comes along with ns-2.0b18, and I use the
default multicast-routing mechanism (i.e. static routing).


        -Chris.