memory allocation optimization step