On 01/07/2014 12:18, Todd B. Stein wrote:
These bugs result in gradual slowdown of indefinitely-running scripts which
rely on parameter substitution (rather than forking sed or awk) for speed
and efficiency. Forgive me if I used the wrong terminology, but whether
these bugs are considered honest-to-goodness "memory leaks" by valgrind
seems unimportant.
google-perftools is able to help analyze such problems.
It can produce memory reports in certain intervals of the program
lifetime, and they graphically show who owns how much memory at
particular times.
In a nutshell, the run is done like this:
HEAPPROFILE=google-profile-pid$$ LD_PRELOAD=/usr/lib/libtcmalloc.so $*
Yuri