[Bug malloc/33886] Fastbin can grow indefinitely and never release
wdijkstr at arm dot com
sourceware-bugzilla@sourceware.org
Thu Mar 19 15:37:40 GMT 2026
https://sourceware.org/bugzilla/show_bug.cgi?id=33886
--- Comment #14 from Wilco <wdijkstr at arm dot com> ---
Thanks, that's quite useful. Those results show there are significant
tradeoffs. However the principle is fine since any blocks that merge with the
top block already call madvise if the top size is larger than the trim
threshold.
The madvise calls result in expensive system wide TLB shootdowns, so they
should be done on larger sizes to amortize the cost. There is also MADV_FREE
which should be cheaper since it doesn't immediately release the pages.
Also it should take into account that the previous/next block it merges with
may already have called madvise, and so we only need to deal with the newly
freed block and any overlaps with the other blocks.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list