Subject: bug#45200: [PATCH] Force Glibc to free the memory freed

From: Konstantin Kharlamov <[email-masked]>
Date: Tue, 26 Jan 2021 01:28:01 +0300

On Mon, 2021-01-25 at 17:17 -0500, DJ Delorie wrote:
> Eli Zaretskii <[email-masked]> writes:
> > Thanks, but is it really a good idea to call malloc_trim each time we
> > free some chunk of memory?
> 
> malloc_trim() is very expensive relative to free(), partly because of
> what it needs to do, and partly because it flushes the fastbins cache.
> If you call it every, say, 1000 iterations of free, that might suffice.
> Or perhaps after each GC run.

(un-ccing Glibc maintainers as this question is Emacs-specific)

After a GC run, would that be at the end of `garbage_collect` function as Stefan
mentioned?