This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]