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

From: Carlos O'Donell <[email-masked]>
Date: Thu, 26 Nov 2020 23:54:21 -0500

On 11/26/20 10:19 AM, Trevor Bentley wrote:
>>> If it's one trace per thread, though, then we at least know that
>>> my emacs process in question is blazing through threads.
>> 
>> I don't see how this could be true, unless some library you use
>> (ImageMagick?) starts a lot of threads.  Emacs itself is
>> single-threaded, and the only other threads are those from GTK,
>> which should be very few (like, 4 or 5).  This assumes you didn't
>> use Lisp threads, of course.
> 
> Oh, it may be subprocesses instead of threads.  emacs-slack is doing
> all sorts of things, involving both ImageMagick and launching curl
> subprocesses.  Is there a way to prevent libmtrace from following
> children?

Each process generates a trace, and that trace contains the data for
all threads in the process.

I've just pushed MTRACE_CTL_CHILDREN, set that to 0 and the children
will not trace. Thanks for the feedback and enhancement.

commit 8a88a4840b5a573c50264f04f68f71d0496913d3
Author: Carlos O'Donell <[email-masked]>
Date:   Thu Nov 26 23:50:57 2020 -0500

    mtrace: Add support for MTRACE_CTL_CHILDREN.
    
    Allow the tracer to only trace the parent process and disable
    tracing in all child processes unless those processes choose
    to programmatically re-eanble tracing via the exposed API.

-- 
Cheers,
Carlos.