Optimize memory performance.