Implement memory profiler