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

From: Jean Louis <[email-masked]>
Date: Sun, 22 Nov 2020 22:52:14 +0300

* Eli Zaretskii <[email-masked]> [2020-11-20 03:11]:
> > Date: Fri, 20 Nov 2020 06:16:26 +0300
> > From: Jean Louis <[email-masked]>
> > Cc: [email-masked], [email-masked], [email-masked],
> >   [email-masked], [email-masked], [email-masked]
> > 
> > * Eli Zaretskii <[email-masked]> [2020-11-19 17:38]:
> > > I think you should try using the malloc tracing tools pointed to here:
> > > 
> > >   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=43389#158
> > 
> > When running for long time Emacs will crush at certain point of time
> > as my hard disk get full as /tmp is just about 2 gigabytes. I did not
> > understand Carlos how to change the location for files.
> 
> Carlos, could you please help Jean to direct the traces to a place
> other than /tmp?

I am now following this strategy here:
https://github.com/jemalloc/jemalloc/wiki/Use-Case%3A-Leak-Checking

I have run emacs -Q for very short time, with:

MALLOC_CONF=prof_leak:true,lg_prof_sample:0,prof_final:true \
LD_PRELOAD=/package/lib/jemalloc/lib/libjemalloc.so.2 emacs -Q

and there are PDF files generated. I also wish to mention that I use 2
dynamic modules, one is emacs-libpq and other emacs-libvterm if that
influences overall. 

You may know easier how to interpret those files and may spot
something. This Emacs session was running just a minute or something. 

https://gnu.support/files/tmp/2020-11-22/jeprof.26889.0.f.heap
https://gnu.support/files/tmp/2020-11-22/jeprof.26889.0.f.heap.pdf
https://gnu.support/files/tmp/2020-11-22/jeprof.26915.0.f.heap
https://gnu.support/files/tmp/2020-11-22/jeprof.26915.0.f.heap.pdf
https://gnu.support/files/tmp/2020-11-22/jeprof.26918.0.f.heap
https://gnu.support/files/tmp/2020-11-22/jeprof.26918.0.f.heap.pdf
https://gnu.support/files/tmp/2020-11-22/jeprof.26921.0.f.heap
https://gnu.support/files/tmp/2020-11-22/jeprof.26921.0.f.heap.pdf
https://gnu.support/files/tmp/2020-11-22/jeprof.26922.0.f.heap
https://gnu.support/files/tmp/2020-11-22/jeprof.26922.0.f.heap.pdf
https://gnu.support/files/tmp/2020-11-22/jeprof.26923.0.f.heap
https://gnu.support/files/tmp/2020-11-22/jeprof.26923.0.f.heap.pdf
https://gnu.support/files/tmp/2020-11-22/jeprof.26924.0.f.heap
https://gnu.support/files/tmp/2020-11-22/jeprof.26924.0.f.heap.pdf
https://gnu.support/files/tmp/2020-11-22/jeprof.26925.0.f.heap
https://gnu.support/files/tmp/2020-11-22/jeprof.26925.0.f.heap.pdf
https://gnu.support/files/tmp/2020-11-22/jeprof.26931.0.f.heap
https://gnu.support/files/tmp/2020-11-22/jeprof.26931.0.f.heap.pdf

I am now running new session and will have maybe quite different data
after hours of run.

Jean