Skip to main content
Stack Overflow
  1. About
  2. For Teams

Timeline for answer to Returning memory from glibc malloc non-main arenas to the operating system by John Bollinger

Current License: CC BY-SA 4.0

Post Revisions

4 events
when toggle format what by license comment
Nov 15, 2025 at 4:29 comment added Forever @Forever When I use the MALLOC_TRIM_THRESHOLD_ parameter, dynamic adjustment will be disabled.In the code, since the allocation size exceeds the M_MMAP_THRESHOLD limit, memory will be allocated via mmap as an independent region.When freeing, it is recognized as an independent region and thus is directly released via munmap, without adhering to the MALLOC_TRIM_THRESHOLD_ limit.
Nov 15, 2025 at 4:28 comment added Forever Thanks for the final note about "some kind of dynamic adaptation." Using the parameter descriptions in this article, I found some changes related to dynamic adjustment, and it seems I’ve found the cause. openeuler.org/en/blog/wangshuo/Glibc%20Malloc%20Principle/…
Nov 13, 2025 at 0:55 comment added Forever Thank you for your reply. Yes, if we go by "that" statement, this parameter does indeed affect the overall non-main area and even glibc’s memory reclamation mechanism. At present, it seems that reclamation is triggered in the non-main arena even before reaching 50 MB, which appears inconsistent with the intended purpose of this parameter.
Nov 12, 2025 at 17:18 history answered John Bollinger CC BY-SA 4.0

AltStyle によって変換されたページ (->オリジナル) /