Rewrite memory workround of profiler