Optimized test memory leak