Haven't worked with Valgrind in a while, and never on MacOS, so not sure. A quick glance at online documentation here and here shows the latest mentioned versions to be a bit old (10.12 and 10.15, I'm running 11.6.7 on my machine). But if you recommend it I'll take a better look.

I was referring to this portion of the manual: link. It seems Emacs is pretty well integrated with gprof. But on Mac I couldn't configure it with the --enable-profiling option; I get this error: clang: error: the clang compiler does not support -pg option on versions of OS X 10.9 and later.

On Fri, Oct 21, 2022 at 8:07 PM Po Lu <luangruo@yahoo.com> wrote:
Andrew De Angelis <bobodeangelis@gmail.com> writes:

> Thanks Daniel! That's very helpful. I was looking at documentation
> online regarding profiling Emacs, but most of it is GNU/Linux focused
> so they'd all mention gprof, which to my understanding doesn't work on
> Mac.  I'll work on using the Instruments.app, that should be very
> helpful in finding the leaks.

Doesn't Valgrind work on Mac OS as well?