Remove code that relies on sbrk()

W.C.A. Wijngaards wouter at nlnetlabs.nl
Tue Nov 22 15:51:41 UTC 2016


Hi Dag-Erling,

On 18/11/16 12:39, Dag-Erling Smørgrav via Unbound-users wrote:
> Unbound pretends to report memory statistics based on the value returned
> by sbrk().  Not only is this non-portable (as demonstrated by r3528 and
> r3911), but it is completely meaningless even on systems that provide
> the sbrk() function.  First, modern allocators (and by "modern" I mean
> "anything written in the last 10-15 years") use mmap(), not sbrk(), to
> manage address space.  Second, even with allocators that do rely on
> sbrk(), it only tells you how much address space is available to the
> program, not how much of it is currently or has ever been used.  The
> attached patch removes all traces of sbrk() from the code.

Thank you, applied this patch.  There are separate debug counters in the
allocation debug code in unbound, so sbrk is not needed.

Not sure if the munin_ graph change is wanted, it was produced with 'ps'
getting the RSS value, and users may appreciate it?

Best regards, Wouter

> 
> DES
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.nlnetlabs.nl/pipermail/unbound-users/attachments/20161122/85d7d831/attachment.bin>


More information about the Unbound-users mailing list