Have you made a checklist of things to be done and then only a few minutes or hours later forgotten most of it?
Just as computers have RAM and hard drive the human mind has two storage repositories.
When we sleep the memories from the day are moved to permanent memory from the hippocampus to the cortex. Now for this activity to take place efficiently we need deep uninterrupted NREM sleep through the night when the activity is accomplished. Approximately 8 hours worth of sleep.
NREM sleep – Non-Rapid eye movement sleep is when you sleep without any bodily motion or entering a dream state.
When you wake up you are fresh and all of the memories have been cleared and moved out for the hippocampus to start again.
When you do not get enough sleep and there is a sleep deficit, your ability to hold on the new information suffers and those are the times you walk into a room with a purpose and find that you remember nothing.
Older people often have broken sleep due to weaker bladder and therefore don’t get enough deep NREM sleep, this causes their memories to suffer. The longer they ignore the fact that they are not getting quality sleep, the poorer their memory becomes and this results in hippocampus overload which leads to dementia where the person does not seem to retain any new information.