Subject: Re: bug#43389: 28.0.50; Emacs memory leaks

From: Eli Zaretskii <[email-masked]>
Date: Tue, 10 Nov 2020 17:53:36 +0200

> From: Andreas Schwab <[email-masked]>
> Cc: Michael Heerdegen <[email-masked]>,  [email-masked],
>   [email-masked]
> Date: Tue, 10 Nov 2020 09:22:20 +0100
> 
> > Yes, the heap.  So it more and more looks like this is the result of
> > glibc not releasing memory to the system, which with some usage
> > patterns causes the memory footprint grow to ludicrous size.
> 
> The heap can only shrink if you free memory at the end of it, so there
> is nothing wrong here.

Yes.  Except that some people say once this problem starts, the memory
footprint starts growing very fast, and the question is why.

Also, perhaps Emacs could do something to prevent large amounts of
free memory from being trapped by a small allocation, by modifying
something in how we allocate memory.

(It is a pity that a problem which was solved decades ago by using
ralloc.c is back, and on GNU/Linux of all the platforms, where such
aspects of memory fragmentation aren't supposed to happen, and all the
malloc knobs we could perhaps use to avoid that were deprecated and/or
removed.)