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

From: Arthur Miller <[email-masked]>
Date: Tue, 24 Nov 2020 03:07:39 +0100

Eli Zaretskii <[email-masked]> writes:

>> From: Arthur Miller <[email-masked]>
>> Cc: [email-masked],  [email-masked],  [email-masked],
>>   [email-masked],  [email-masked],  [email-masked],
>>   [email-masked]
>> Date: Mon, 23 Nov 2020 20:49:48 +0100
>> 
>> Isn't Valgrind good for this kind of problems? Can I run emacs as a
>> systemd service in Valgrind?
>
> You can run Emacs under Valgrind, see etc/DEBUG for the details.  But
> I'm not sure it will work as systemd service.
>
> Valgrind is only the right tool if we think there's a memory leak in
> Emacs itself.
Yeah, you are right;

I was trying to crash my Emacs for like 4 hours now, I tried to simulate
dired and copying/moving around files since I experienced crashes mostly
when in dired and helm; I put a function on a timer where I made 1000 files every
few seconds, red those files back inoto lists, copy them around and deleted
them; and watched allocations and all I got was spent time; Emacs was
rock solid. Typical :D.

I hope that this pmem for the process is correct; I was looking at
attributes and I saw it go up and down, but it seemed to stay in reange
~2.5 tp ~3.5%, 

This looked typical, pmem was different for every run, but stayed below
3.5%

((args . "/home/arthur/repos/emacs/src/emacs --fg-daemon") (pmem . 2.919526565234921) (pcpu . 13.355092518800808) (etime 0 5521 40000 0) (rss . 958748) (vsize . 1125912) (start 24508 19530 683640 125000) (thcount . 2) (nice . 0) (pri . 20) (ctime 0 6 880000 0) (cstime 0 0 420000 0) (cutime 0 6 460000 0) (time 0 737 340000 0) (stime 0 47 950000 0) (utime 0 689 390000 0) (cmajflt . 485) (cminflt . 214598) (majflt . 73) (minflt . 1286399) (tpgid . -1) (ttname . "") (sess . 24105) (pgrp . 24105) (ppid . 595) (state . "R") (comm . "emacs") (group . "users") (egid . 100) (user . "arthur") (euid . 1000))

((args . "/home/arthur/repos/emacs/src/emacs --fg-daemon") (pmem . 2.919526565234921) (pcpu . 13.355092518800808) (etime 0 5521 40000 0) (rss . 958748) (vsize . 1125912) (start 24508 19530 684725 570000) (thcount . 2) (nice . 0) (pri . 20) (ctime 0 6 880000 0) (cstime 0 0 420000 0) (cutime 0 6 460000 0) (time 0 737 340000 0) (stime 0 47 950000 0) (utime 0 689 390000 0) (cmajflt . 485) (cminflt . 214598) (majflt . 73) (minflt . 1286399) (tpgid . -1) (ttname . "") (sess . 24105) (pgrp . 24105) (ppid . 595) (state . "R") (comm . "emacs") (group . "users") (egid . 100) (user . "arthur") (euid . 1000))

((args . "/home/arthur/repos/emacs/src/emacs --fg-daemon") (pmem . 2.919526565234921) (pcpu . 13.355092518800808) (etime 0 5521 40000 0) (rss . 958748) (vsize . 1125912) (start 24508 19530 685810 502000) (thcount . 2) (nice . 0) (pri . 20) (ctime 0 6 880000 0) (cstime 0 0 420000 0) (cutime 0 6 460000 0) (time 0 737 340000 0) (stime 0 47 950000 0) (utime 0 689 390000 0) (cmajflt . 485) (cminflt . 214598) (majflt . 73) (minflt . 1286399) (tpgid . -1) (ttname . "") (sess . 24105) (pgrp . 24105) (ppid . 595) (state . "R") (comm . "emacs") (group . "users") (egid . 100) (user . "arthur") (euid . 1000))

((args . "/home/arthur/repos/emacs/src/emacs --fg-daemon") (pmem . 2.919526565234921) (pcpu . 13.355092518800808) (etime 0 5521 40000 0) (rss . 958748) (vsize . 1125912) (start 24508 19530 686711 538000) (thcount . 2) (nice . 0) (pri . 20) (ctime 0 6 880000 0) (cstime 0 0 420000 0) (cutime 0 6 460000 0) (time 0 737 340000 0) (stime 0 47 950000 0) (utime 0 689 390000 0) (cmajflt . 485) (cminflt . 214598) (majflt . 73) (minflt . 1286399) (tpgid . -1) (ttname . "") (sess . 24105) (pgrp . 24105) (ppid . 595) (state . "R") (comm . "emacs") (group . "users") (egid . 100) (user . "arthur") (euid . 1000))

((args . "/home/arthur/repos/emacs/src/emacs --fg-daemon") (pmem . 2.919526565234921) (pcpu . 13.355092518800808) (etime 0 5521 40000 0) (rss . 958748) (vsize . 1125912) (start 24508 19530 687465 69000) (thcount . 2) (nice . 0) (pri . 20) (ctime 0 6 880000 0) (cstime 0 0 420000 0) (cutime 0 6 460000 0) (time 0 737 340000 0) (stime 0 47 950000 0) (utime 0 689 390000 0) (cmajflt . 485) (cminflt . 214598) (majflt . 73) (minflt . 1286399) (tpgid . -1) (ttname . "") (sess . 24105) (pgrp . 24105) (ppid . 595) (state . "R") (comm . "emacs") (group . "users") (egid . 100) (user . "arthur") (euid . 1000))

I will see it comes back, and see if I can play more with it; I give up for now.