improve memory initialize for simulation