move memory allocation timing