Added a chapter on memory allocation

Added a short chapter on memory allocation in 'Memory optimization' and slightly improved README.