Added memory monitoring to benchmarks.