gperftools

Multi-threaded malloc() and performance analysis tools for C/C++

brewmacoslinux
Try with needOr install directly
Source

About

Multi-threaded malloc() and performance analysis tools

Commands

pproftcmalloc_unittestheap_checkerheap_profiler

Examples

Profile heap memory usage of a C++ application$ HEAPPROFILE=/tmp/heap_profile ./your_app && pprof ./your_app /tmp/heap_profile.0001.heap
Detect memory leaks with heap checker$ HEAPCHECK=strict ./your_app
Analyze CPU performance of a program$ CPUPROFILE=/tmp/cpu_profile ./your_app && pprof ./your_app /tmp/cpu_profile