According to National Public Radio “Sleeps link to Learning and memory are traced to brain chemistry.” Scientists reported at the Society for Neuroscience meeting in Washington DC that during sleep chemicals in the brain help us commit events to memory. Ravi Allada, a sleep expert from Northwestern University says that the most important thing that happens during sleep is the strengthening of memory, however, the connection was unclear until recently. At the meeting Jennifer Choi Tudor at the University of Pennsylvania explained that there is a brain chemical called 4EBP2 that is created in sleep and may play a role in memory. An experiment was done on mice and with the chemical their memory improved tremendously.
Another thing interesting to note is that mice that ate during normal sleeping hours were more likely to do worse on memory tests than mice that did not eat. Maybe skip that midnight snack.
To read more about the study check out the article from Helen Sanders, chief editor at Health Ambiton.