Tuning memory layout