add memory profiling