]> git.ipfire.org Git - thirdparty/man-pages.git/commit
malloc_trim.3: Update trimming information
authorCarlos O'Donell <codonell@redhat.com>
Thu, 28 Mar 2019 18:01:28 +0000 (14:01 -0400)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 14 Apr 2019 17:12:34 +0000 (19:12 +0200)
commit0deebbe52415e2c85d53902613e51a7b01ea867a
treec4fdefaaffd4b855166b83e96df4b80598d27bda
parent492a6a0d4a4cc9c606459eff7d627e172d0bbc3e
malloc_trim.3: Update trimming information

Since glibc 2.8, commit 68631c8eb92, the malloc_trim function has
iterated over all arenas and free'd back to the OS all page runs
that were free.  This allows an application to call malloc_trim to
consolidate fragmented chunks and free back any pages it can to
potentially reduce RSS usage.

This correctness of the man page was recently brought to light by
an article [1] where Ruby developers discovered that malloc_trim
did not behave as the man page indicated.

This change makes it clear that the intent of malloc_trim is to
trim all space that is no longer needed, and any restrictions are
implementation details. In the notes we highlight the change in
behaviour for post glibc 2.8 and pre glibc 2.8.

[1] https://www.joyfulbikeshedding.com/blog/2019-03-14-what-causes-ruby-memory-bloat.html#a-magic-trick-trimming

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/malloc_trim.3