There is a difference between plagiarism and cheating. Plagiarism is taking someone else's work or ideas and representing them as your own (no matter whether verbatim or with some modification to hide their origin). Cheating during an exam, on the other hand, is using any help or sources of information you are not supposed to use (like peeking at a hidden cheatsheet or textbook, or having someone read it to you via a small earbud).
In your case, it appears that you are supposed to summarize what you have learned from lectures and the textbook. This implies that your answer can contain information taken from the textbook, so plagiarism is not an issue here (unless you were asked to come up with your own examples demonstrating the application of the knowledge you learned, but you took your examples from the textbook or some source rather than creating your own).
Now, about cheating. Unless you did peek at a textbook or other source of information you were not supposed to use, reproducing parts of it from memory is not cheating. But your professor might suspect cheating if you reproduce large fragments from the textbook verbatim, because it is unusual to have such a good memory (unusual, but not impossible—I knew a person who could recite many pages of text verbatim after reading it once or twice). If you have such a good memory, then it is likely that either your professor has already noticed it or that you can prove your unusual abilities. To avoid suspicion and possible need to explain yourself, I would recommend asking your professor about it beforehand.
Another concern that your professor might have is that, although you can reproduce large portions of learned material from memory verbatim, your essay does not show that you understand the material or can apply it in practice when the need arises. Make sure your essay includes your own thoughts that demonstrate your understanding.