This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Question regarding bug 1128.
- From: "Kaz Kylheku" <kaz at zeugmasystems dot com>
- To: <libc-alpha at sources dot redhat dot com>
- Date: Thu, 27 Mar 2008 15:45:40 -0700
- Subject: Question regarding bug 1128.
Hi All,
I'm scoping a fix for bug 1128 against malloc, i.e these problems:
- after sbrk fails, mmap is used, rendering the main_arena
non-contiguous, so that free no longer returns memory to the OS.
- sbrk keeps being re-tried anyway.
My question is, would it make sense to borrow arenas to fix this?
That is to say, if USE_ARENAS is enabled, would it be a good
strategy, if sbrk fails in main_arena, to simply switch to
or allocate another arena, thereby leaving main_arena contiguous?
Is there anything wrong with this obvious approach?
Then the main_arena could give back memory to the OS using
negative sbrk calls, malloc wouldn't be hammering away at a
non-working sbrk in main_arena, and the new arena would also
give back memory to the OS using munmap by way of heap_trim.
Thanks for any feedback.