Why Large Language Models Need Memory: Understanding the Three-Dimensional Framework of Memory for Large Language Models