Yoga Sutras 1.11
Patanjali, explained by Swami Vivekananda
अनुभूतविषयासम्प्रमोषः स्मृतिः ॥
anubhūtaviṣayāsampramoṣaḥ smṛtiḥ
Memory is when the (Vrittis of) perceived subjects do not slip away (and through impressions come back to consciousness).
In plain words: Memory is when past experiences do not fade away but come back to mind. The teacher says dreams are memories stirred up during sleep.
Swami Vivekananda explains
Memory can come from direct perception, false knowledge, verbal delusion, and sleep. For instance, you hear a word. That word is like a stone thrown into the lake of the Chitta; it causes a ripple, and that ripple rouses a series of ripples; this is memory. So in sleep. When the peculiar kind of ripple called sleep throws the Chitta into a ripple of memory, it is called a dream. Dream is another form of the ripple which in the waking state is called memory.