Maintained by: NLnet Labs

Remove code that relies on sbrk()

Dag-Erling Smørgrav
Fri Nov 18 19:24:27 CET 2016


Taylor R Campbell <campbell+unbound at mumble.net> writes:
> Both jemalloc and glibc use sbrk in addition to mmap.

Jemalloc *can* use sbrk() in addition to mmap() if enabled at build
time, but even then, it will try mmap() first, unless you explicitly
configure it at runtime to prefer sbrk() over mmap().  And it's still
not a meaningful measure of the amount of memory in use.

> glibc and at least some versions of jemalloc use brk(p) or sbrk(-x) to
> release part of the data segment back to the operating system.

Which will only work if the heap is not very fragmented.

DES
-- 
Dag-Erling Smørgrav - des at des.no