generate memory