Long term memory is closely related to sleep. When we sleep our short term memory is basically copied into our long term memory. If somebody is not sleeping enough trying to prepare for exam, this a huge mistake. After several days everything will be forgotten and days of practice lost. There are ways of improving sleep and improve memory performance while you sleep. These ways are subtle, they may work for ~90% of the people, yet you might belong to the other 10%….
Sleep contains several cycles, out of which REM cycle is the most important and the last cycle of sleep. If naps perfectly timed throughout the day you may maximize the time you spend in REM. This does not mean that other parts of your sleep are not important. In fact, we do not fully know what happens to us when we sleep. For example alpha waves are produced in early sleep, REM and in meditation – you can train producing alpha waves to fight exhaustion and burnout improving your mental well-being. Beta and gamma waves happen during next sleep stage and they influence your focus and alertness. There are specific biofeedback training procedures and computer exercises for various brain wave types, yet if you have a good night sleep and occasional nap you do not need these crunches.
If you do not get enough sleep, first thing to do is check your vitamin D level. This is especially important if your skin is no exposed to sunlight. Otherwise try to understand what is causing your insomnia and experiment a bit with your daily routine: do not get blue light (computer, TV) before you go to sleep, try to walk or meditate before sleep, change the time when you go to sleep etc. In some rare cases you will need help of trained professionals.
Lucid dreaming is a state between fully sleeping and being awake, when you can exercise some control over your dreams. Recreational lucid dreamers use this power to create relaxed and peaceful environments or alternatively to transform themselves into superheroes. A better way of using lucid dream is traveling your mental palaces and manipulating your mindmaps. If you work with your mental structures when dreaming, you have a higher chance of remembering them, yet there is also a chance you will mess up with data integrity and change things from their original content to something very different.
This article on lucid dreaming explains how you can train yourself to enter into the lucid dreaming state. Essentially you slowly increase the control you have over your dreams until you are in full control. The process should probably take around 3 months. I never tried lucid dreams, instead I used visualization techniques while meditation to achieve similar results.
To summarize this post: good mental health and memory require good sleep, once you get good sleep you can try controlling the sleep, if you can control the sleep you will improve long-term memory. Alternatively you can use similar techniques when meditating.