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: 6224 B 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: 6224 B 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
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
On Wed, Apr 14, 2021 at 10:56:14AM +0000, 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.
Hello Yes, this branch is definitely still WiP. Will check that. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
participants (3)
-
Macek, Dawid -
Maria Matejka -
Ondrej Zajicek