Memory usage optimizations