]> git.ipfire.org Git - thirdparty/bird.git/commit
Memory statistics split into Effective and Overhead
authorMaria Matejka <mq@ucw.cz>
Fri, 26 Nov 2021 23:21:12 +0000 (00:21 +0100)
committerMaria Matejka <mq@ucw.cz>
Sat, 27 Nov 2021 21:54:15 +0000 (22:54 +0100)
commitf772afc525156498900770ffe5a98349df89a45c
treefef3e68e487fb35335bdb14eb60821165b7dc066
parent644e9ca94e2d10ba0c2de45f94523da2414328e3
Memory statistics split into Effective and Overhead

This feature is intended mostly for checking that BIRD's allocation
strategies don't consume much memory space. There are some cases where
withdrawing routes in a specific order lead to memory fragmentation and
this output should give the user at least a notion of how much memory is
actually used for data storage and how much memory is "just allocated"
or used for overhead.

Also raising the "system allocator overhead estimation" from 8 to 16
bytes; it is probably even more. I've found 16 as a local minimum in
best scenarios among reachable machines. I couldn't find any reasonable
method to estimate this value when BIRD starts up.

This commit also fixes the inaccurate computation of memory overhead for
slabs where the "system allocater overhead estimation" was improperly
added to the size of mmap-ed memory.
lib/mempool.c
lib/resource.c
lib/resource.h
lib/slab.c
nest/cmds.c