[c-nsp] Possible BGP memory leak?

Ed Ravin eravin at panix.com
Tue Aug 21 01:26:23 EDT 2007


On Tue, Aug 21, 2007 at 07:10:08AM +0200, Oliver Boehmer (oboehmer) wrote:
> Ed Ravin <> wrote on Tuesday, August 21, 2007 3:29 AM:
> 
> > On a 7513 router running 12.0(S), we're running rather low on memory.
> > Yes, I know of the futility of fitting two full Internet feeds into
> > 256M, and I'm working on that, but in the meantime, this looks weird:
> > 
> > Router# show proc mem | inc Hold|BGP
> >  PID TTY  Allocated      Freed    Holding    Getbufs    Retbufs
> >  Process 151   0  320352144  140361924  178607164          0         
> >  0 BGP Router 152   0     328008     619156       6984          0    
> >  0 BGP I/O 153   0          0     673324       9984          0       
> > 0 BGP Scanner 
> > 
> > Is the "BGP Router" process really holding 178 MB of memory?  Why
> > does it only seem to be 51 MB in the listing below?
> > 
> > Router# show ip bgp summary
> > [...]
> > 185673 network entries using 20981049 bytes of memory
> > 369703 path entries using 19224556 bytes of memory
> > 73675/35141 BGP path/bestpath attribute entries using 9725100 bytes
> > of memory 63197 BGP AS-PATH entries using 1662392 bytes of memory
> > 4 BGP community entries using 96 bytes of memory
> > 0 BGP route-map cache entries using 0 bytes of memory
> > 0 BGP filter-list cache entries using 0 bytes of memory
> > BGP using 51593193 total bytes of memory
> > BGP activity 522211/336538 prefixes, 1394152/1024449 paths, scan
> > interval [...]
> 
> The memory reported by "show ip bgp summary" only counts pure BGP data
> structures. The total memory allocated by the BGP router process
> includes RIB and CEF structures as it's the BGP router who installs the
> routes into the RIB/FIB. 
> So the above looks expected..

But I still suspect there's a memory leak somewhere since after I did
"no router bgp" and then re-added the original BGP config, the new
BGP process was using about 20 MB less memory even though the number
of prefixes/paths hasn't changed much:

Router# show proc mem | inc Hold|BGP
 PID TTY  Allocated      Freed    Holding    Getbufs    Retbufs Process
 153   0  155900376       2256  155855424          0          0 BGP Router
 155   0          0          0       6984          0          0 BGP I/O
 157   0          0        328       9984          0          0 BGP Scanner


l3core.nyc.w18#show ip bgp summary
[...]
185700 network entries using 20984100 bytes of memory
369756 path entries using 19227312 bytes of memory
73652/34818 BGP path/bestpath attribute entries using 9722064 bytes of
memory
63172 BGP AS-PATH entries using 1661812 bytes of memory
4 BGP community entries using 96 bytes of memory
2 BGP route-map cache entries using 64 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP using 51595448 total bytes of memory
BGP activity 186004/304 prefixes, 370621/865 paths, scan interval 60 secs



More information about the cisco-nsp mailing list