[sheepdog] [PATCH] sheep: disable glibc's dynamic mmap threshold

MORITA Kazutaka morita.kazutaka at gmail.com
Thu Jun 20 02:34:13 CEST 2013


At Tue, 18 Jun 2013 23:24:48 +0800,
Liu Yuan wrote:
> 
> This solves the problem that freed memory is retained in the long running sheep.
> 
> This is due to glibc's memory allocation implementation (ptmalloc). For
> allocations greater than or equal to the limit specified by M_MMAP_THRESHOLD
> that can't be satisfied from the free list, the memory-allocation functions
> employ mmap(2) instead of increasing the program break using sbrk(2).
> 
> So for the long running sheep,
> 1 M_MMAP_THRESHOLD is increased to the extent that all the allocation use its
>   internal cached chunks on the heap.
> 2 ptmalloc can't release the memory of sub-heap back if top chunk is in use.
> 
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  sheep/sheep.c |   17 +++++++++++++++++
>  1 file changed, 17 insertions(+)

Applied, thanks!

Kazutaka



More information about the sheepdog mailing list