]> git.proxmox.com Git - mirror_frr.git/commit
bgpd: fix memory leak in evpn json outputs
authorChirag Shah <chirag@cumulusnetworks.com>
Wed, 22 Jan 2020 20:22:27 +0000 (12:22 -0800)
committerChirag Shah <chirag@cumulusnetworks.com>
Fri, 24 Jan 2020 20:17:17 +0000 (12:17 -0800)
commita1df2ac5996a74dd65a8d1abfa3824ab5de11510
tree56afd996521f464672c94bdd29bbd04f5429d259
parentbe3a8fa8f8ee34a2b15eac517f7eb7bad7978d1f
bgpd: fix memory leak in evpn json outputs

Found memory leak in json output of evpn's route
commands.

After executing 'show bgp l2vpn evpn route type prefix json'
and 'show bgp l2vpn evpn route type macip json' few times
(6 times) with more than 600 routes in total seeing
memory footprint for bgpd continue to grow.

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  12 MiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  8390 KiB
  Free small blocks:     1760 bytes
  Free ordinary blocks:  3762 KiB
  Ordinary blocks:       1161
  Small blocks:          51
  Holding blocks:        0

Ticket:CM-27920
Testing Done:

After fix:
excute few times,
'show bgp l2vpn evpn route type prefix json'
and 'show bgp l2vpn evpn route type macip json'
commands where used ordinary blocks (uordblks) is
in steady state.

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  9968 KiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  6486 KiB
  Free small blocks:     1984 bytes
  Free ordinary blocks:  3482 KiB
  Ordinary blocks:       1110
  Small blocks:          54
  Holding blocks:        0

Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  10100 KiB
  Holding block headers: 0 bytes
  Used small blocks:     0 bytes
  Used ordinary blocks:  6488 KiB
  Free small blocks:     1984 bytes
  Free ordinary blocks:  3612 KiB
  Ordinary blocks:       1113
  Small blocks:          54
  Holding blocks:        0

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
bgpd/bgp_evpn_vty.c