I looked for existing answers first and saw that Valgrind is everyone’s favorite tool for memory leak debugging on linux. Unfortunately Valgrind does not seem
You might also consider using Google's gperftools, which has a heap profiler that can be loaded via LD_PRELOAD. You can also link in its tcmalloc and leak checker into your binary, and enable them only when needed.
For details, see https://github.com/gperftools/gperftools