[BUG] BMP memory leak

Maria Matejka maria.matejka at nic.cz
Wed Apr 14 14:17:10 CEST 2021


Hello!

As the first part of investigation, I would try to run BIRD with a debug 
logfile on:
bird -D <filename>

Then from CLI, you issue a command "dump resources", causing a memory 
allocation flush to the debug logfile.

As BIRD obviously knows about this memory, it must also know where it is 
and this command dumps it. Doing this for both versions should yield 
more precise information than just "show memory" and point you to the 
probable cause.

If you couldn't find a cause from that, feel free to send us the memory 
dumps for investigation and comparison.

Maria

On 4/14/21 12:56 PM, Macek, Dawid wrote:
> Hello,
> 
> We’ve built Bird from origin/bmp branch and found out that BMP most 
> likely introduces memory leak.
> 
> In the experiment, the device has 4 BGP peers (see attached bird.conf).
> 
> The device is flooded with massive number of routes from each peer.
> 
> Memory-usage snapshots are taken: before flooding with routes, after 
> flooding with routes,
> 
> after dropping BGP sessions and waiting for routes to be removed for Linux.
> 
> The experiment was performed twice: with and without BMP configured.
> 
> Case 1: With BMP configured:
> 
>    Before flooding:
> 
>     BIRD memory usage
> 
>     Routing tables: 20 kB
> 
>     Route attributes: 6224B
> 
>     Protocols:33 kB
> 
>     Total: 123 kB
> 
> After flooding (about 1150000 routes in Linux):
> 
>    BIRD memory usage
> 
>     Routing tables:412 MB
> 
>     Route attributes: 11 kB
> 
>     Protocols:1473 MB
> 
>     Total:1885 MB
> 
> After dropping BGP sessions and waiting for routes to be removed from 
> kernel:
> 
>     BIRD memory usage
> 
>     Routing tables:284 kB
> 
>     Route attributes: 10 kB
> 
>     Protocols:1018 MB
> 
>     Total:1019 MB
> 
> Case 2: Same config, but without protocol bmp {…}:
> 
>    Before flooding:
> 
>      BIRD memory usage
> 
>      Routing tables: 20 kB
> 
>      Route attributes: 6224B
> 
>      Protocols:26 kB
> 
>      Total: 112 kB
> 
>    After flooding (about 1130000 routes in Linux):
> 
>      BIRD memory usage
> 
>      Routing tables:381 MB
> 
>      Route attributes: 11 kB
> 
>      Protocols: 163 MB
> 
>      Total: 544 MB
> 
>    After dropping BGP sessions and waiting for routes to be removed from 
> kernel:
> 
> BIRD memory usage
> 
>      Routing tables:284 kB
> 
>      Route attributes: 10 kB
> 
>      Protocols: 795 kB
> 
>      Total:1153 kB
> 
> We would like to ask about code examination and pointing us towards 
> probable cause of the issue,
> 
> because we are unable to find it ourselves.
> 
> Thanks in advance and regards,
> 
> Dawid Macek
> 


More information about the Bird-users mailing list