One of the main problems we have with learning the classical guitar is performing pieces by memory. Students tend to watch the notated music as they play, and their mind is busy looking at notes and fingerings. Most of the time very little listening is done.
Most young rock guitarists can memorize many songs per week with very little effort. What is their secret? Very simple - they play along with the album they want to learn until they can anticipate every chord change. Then, without the album playing, they can hear the song inside their mind and follow it.
Many classical guitar students perform pieces in the same way they watch TV - completely detached from the action. They watch the music on the stand, they watch their hands, they might even memorize the fingering in a few passages, but they never actually hear the piece they are playing. Everything becomes external - that is, everything is happening outside of them. There is no internal guide, and therefore, nothing to follow.
For a long time I would tell my students to know their harmony, analyze the piece, visualize the fingering, etc. and yes, all these techniques do help - but you can do all of that and still not know how the tune sounds. The easiest way to memorize music is simply - sing the tune as you play it.
Remember, we want to build a strong foundation inside as well as outside. When we sing and play, we are actively involved in memorizing the piece. We are connecting the inner tune to the outer manifestation (the physical performance). Don't worry in any way if you can't sing in perfect tune, or that you can't sing every single voice independently - none of that matters. Just sing what you can, however you can.
Within a short time, you may sing the tune away from the guitar, and you'll notice that the fingerings just seem to "pop" into your mind. Why? Because your mind has developed an association between the tune, and what it "looks" like. The mind now literally thinks of the tune as a physical act being done by your hands. At that point you've merged the internal and external worlds and memorizing becomes far easier. Give it a try and see.