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

From: Stefan Monnier <[email-masked]>
Date: Tue, 26 Jan 2021 10:30:07 -0500

> That'd be easy to implement, but I'm not yet sure it's the best
> alternative.  In particular, I'd like to have some idea regarding how
> much time such a call could take.  In some usage patterns Emacs calls
> GC very frequently, which slows down command execution and makes Emacs
> less responsive.

The most important case where this happens is during phases of creation
of large new structures (e.g. while loading a large package like Org),
where a lot of memory is allocated without generating much garbage, so
every time we run the GC that time is mostly wasted (since we don't
recover any garbage) and calling malloc_trim would also be useless in
those cases.

        Stefan