Memory optimizations.