simple whole-program memory profiling