Implement memory distribution.