main memory optimizations