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

From: Jean Louis <[email-masked]>
Date: Wed, 18 Nov 2020 00:45:48 +0300

* DJ Delorie <[email-masked]> [2020-11-17 23:57]:
> Jean Louis <[email-masked]> writes:
> > After days I will tell more.
> 
> Do we have any strong hints on things we (i.e. I) can do to cause this
> to happen faster?

This is because I cannot know when is it happening. In general it was
taking place almost all the time under EXWM (Emacs X Window Manager)
then I switched to IceWM just to see if it is problem that EXWM is
invoking. Now in IceWM I got it 3 times, but much less times than in
EXWM and I do not see that I anyhow have changed my habits of using
Emacs.

Today I had more than 10 hours session and then what I did? I do not
know exactly. I have kept only XTerm and Emacs on X, at some point of
time it starts using swap but it is unclear to me if it uses swap or
does something else with the disk. Some minutes before that I was
inspecting it with htop and found Emacs with 9.7 GB memory. Later
system was unusable.

All I could see during that time is hard disk LED turned on all the
time. I cannot do almost nothing, I cannot interrupt Emacs or switch
to console. Then I use Magic SysRq and do the necessary to at least
synchronize hard disks, unmount and reboot.

I am running it with this script:

#!/bin/bash
# CDPATH invokes bugs in eshell, not related to this
unset CDPATH
# I was trying to tune ulimit -m but it did not help
# ulimit -m 3145728
# I am trying this now
export MALLOC_ARENA_MAX=4
date >> /home/data1/protected/tmp/emacs-debug
# This below is for M-x malloc-info
emacs >> /home/data1/protected/tmp/emacs-debug 2>&1

Maybe some simple new and automatic function could be temporarily
included to spit errors to output on what is Emacs doing when it
starts swapping (if it is swapping), then such errors could at least
be captured in a file even if I have to reboot computer.