]> git.proxmox.com Git - mirror_frr.git/commit - lib/memory_vty.c
lib: Memory reporting fails over 2GB
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 28 Oct 2015 23:59:30 +0000 (19:59 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 29 Oct 2015 12:59:23 +0000 (05:59 -0700)
commit6896f650180700bafc543af21701be8b79eeee61
treeb0d25cd57d728041a0f1cfe72582ace283b3750e
parenta6e0d253a2d0f38146c3551ea1fd93524a53de7e
lib: Memory reporting fails over 2GB

Ticket: CM-8015
Reviewed by: CCR-3717
Testing: See bug

The old style mallinfo() function uses an 'int' to
report memory usage data to the program.  Unfortunately
modern architectures can chew through 2gb of memory like a
buzz saw hitting some warm butter, especially in the case
of a memory leak or memory fragmentation.

When a daemon uses more than 2gb of memory, just indicate it's
gotten large and we don't know anymore.

Pre-change behavior:
Robot-1# show memory
System allocator statistics:
Total heap allocated: 16777216 TiB
Holding block headers: 1288 KiB
Used small blocks: 0 bytes
Used ordinary blocks: 535 MiB
Free small blocks: 768 bytes
Free ordinary blocks: 16777216 TiB
Ordinary blocks: 266107
Small blocks: 24
Holding blocks: 2

Post-change behavior:
Robot-1# show memory
System allocator statistics:
  Total heap allocated:  1572 KiB
  Holding block headers: > 2GB
  Used small blocks:     0 bytes
  Used ordinary blocks:  1443 KiB
  Free small blocks:     32 bytes
  Free ordinary blocks:  129 KiB
  Ordinary blocks:       2
  Small blocks:          1
  Holding blocks:        2

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/memory.c