[PATCH v2] Allow shrinking of arena heaps using mmap based on overcommit settings when available
Siddhesh Poyarekar
siddhesh@redhat.com
Wed Aug 22 08:51:00 GMT 2012
On Wed, 22 Aug 2012 00:06:10 +0530, Siddhesh wrote:
> ChangeLog:
>
> * malloc/arena.c: Include malloc-sysdep.h.
> (shrink_heap): New static variable may_shrink_heap to decide
> if madvise is sufficient to shrink the heap or an unmap is needed.
> * sysdeps/generic/Makefile (sysdep_headers): Add
> malloc-sysdep.h as a dependency when building malloc.
> * sysdeps/generic/malloc-sysdep.h: New file. Define
> new function check_may_shrink_heap.
> * sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Add
> malloc-sysdep.h as dependency when building malloc.
> * sysdeps/unix/sysv/linux/malloc-sysdep.h: New file. Define
> new function check_may_shrink_heap.
>
I have attached an updated patch after Florian pointed out that I had
leaked a file descriptor. The ChangeLog remains the same.
Regards,
Siddhesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: heap-shrink.patch
Type: text/x-patch
Size: 5357 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20120822/a1b5a1ad/attachment.bin>
More information about the Libc-alpha
mailing list