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

From: Carlos O'Donell <[email-masked]>
Date: Sun, 22 Nov 2020 22:35:28 -0500

On 11/19/20 10:16 PM, Jean Louis wrote:
> * 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.
 
The glibc malloc tracer functionality can be adjusted with environment
variables.

Example:

MTRACE_CTL_VERBOSE=1 MTRACE_CTL_FILE=./ls.mtr LD_PRELOAD=./libmtrace.so ls
mtrace: writing to ./ls.mtr.350802

The appended PID helps keep the files distinct (and includes a sequence
number in the event of conflict).

In the above example the use of MTRACE_CTL_FILE=./ls.mtr instructs the
tracer to write the trace file to the current directory.

The tracer appends the PID of the traced process to the ls.mtr file name
(and a sequence number that increases monotonically in the event of a
name conflict).

-- 
Cheers,
Carlos.