Added a chapter on memory allocation to 'Memory optimization'
Markdown error fixed.
Memory allocation section improved.