Subject: bug#43389: 28.0.50; Emacs memory leaks using hard disk all time

From: Andrea Corallo <[email-masked]>
Date: Mon, 23 Nov 2020 20:53:37 +0000

Arthur Miller <[email-masked]> writes:

> Andrea Corallo <[email-masked]> writes:
>
>> I think would be nice to have a script that monitors Emacs memory
>> footprint and attach gdb on it when the memory usage is over a certain
>> (high) threshold.
>>
>> This way should be easy to see what we are doing because at that point
>> we are supposed to be allocating extremely often.
>>
>>   Andrea
> Indeed.

*not* very much tested:

<https://gitlab.com/koral/mem-watchdog.el/-/blob/master/mem-watchdog.el>

You can run an Emacs -Q where you use this to monitor the Emacs you are
working on (hopefully the first one does not crash too).  Note you have
to set the OS to allow for gdb to attach on other processes or run the
Emacs monitor as root.

Hope it helps.

  Andrea