[PATCH v2] Remove upper limit on tunable MALLOC_MMAP_THRESHOLD

Patrick McGehearty patrick.mcgehearty@oracle.com
Tue Nov 9 22:33:11 GMT 2021


If a chunk smaller than the mmap_threshold is requested,
then MORECORE [typically sbrk()] is called and HEAP_MAX
is not considered by the malloc code.  Heaps are only used
for mmap()ed allocations, not sbrk()'ed allocations,
so far as I can tell in reading the code.

Setting a higher default HEAP_MAX would mean the main arena
would by default be larger which might cause issues for
applications with many, many threads. For that reason,
I did not consider changing the default HEAP_MAX as part
of this patch.

It might be desirable to also allow HEAP_MAX to be set by
the user before the first call to malloc, but I see that
as a separate task.

-  patrick

On 11/1/2021 7:27 PM, DJ Delorie wrote:
> If mmap_threshold is greater than heap_max, what happens when you
> allocate a chunk between those two sizes?
>



More information about the Libc-alpha mailing list