c++ – Framework to benchmark your program memory consumption

To benchmark performance of my cpp code I use google benchmark. As we all know, it runs code I want to benchmark many times and prints the time. In combination with profiler, this is super useful tool.
The question is if there is such a tool for memory benchmarking? My particular need is to develop a reproducible procedure to measure the memory used to perform some computations. Right now I use valgrind tools in a manual regime, I’m sure that some people has automated this.