fix profiler memory usage