Add facility to compute peak memory usage