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

From: Russell Adams <[email-masked]>
Date: Tue, 15 Sep 2020 23:12:09 +0200

On Tue, Sep 15, 2020 at 09:52:45PM +0300, Eli Zaretskii wrote:
> > htop says my emacs RSS is now 5148MB. I ran M-x garbage-collect and it ran
>
> Can you use some utility that produces a memory map of an application,
> and see how much of those 5GB are actually free for allocation by
> Emacs?

Any suggestions? I still have it running. I used htop because it shows
a sane total value.

> Also, do you see any libraries used by Emacs that have high
> memory usage?

Emacs is the top memory usage on my laptop, firefox is second at
2GB. The rest are <1G.

> 28% and 33% of what amount?

16GB

> If your RSS is 5GB after 4 days of uptime, and the memory footprint
> grows at a constant rate, it would mean more than 1GB per day.  But
> I'm guessing that 33% - 28% = 5% of your total memory is much less
> than 1GB.

No, 33% is ~5GB. ;]

> In which case the memory footprint must sometimes jump by
> very large amounts, not grow slowly and monotonically each day.
> Right?  So which events cause those sudden increases in RSS?

I can't say. I have a few megs total in buffers open, and I've run
org-caldav a few times to upload. Mostly org-mode buffers open, a few
mail buffers (not gnus, just mail-mode editing mutt files), package
list, and cruft. Not actively doing any development, just editing Org
files.

I don't recall having edited any huge files in the last 4 days.

> Also, what is your value of gc-cons-threshold, and do you have some
> customizations that change its value under some conditions?  If so,
> please tell the details.

gc-cons-threshold is 800000 (#o3032400, #xc3500).

No customization that I'm aware of to memory. The only thing that may
be relative is my savehist settings, but that file is only 98k (down
from 500meg in emacs 26). I've now limited my savehists.

------------------------------------------------------------------
Russell Adams                            [email-masked]

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3