A dream in which you remember something that you tend to forget while awake could be a warning from the subconscious not to forget something. Occasionally, you awake in an abrupt manner to make sure that your memory has not fooled you in a way that could bring negative consequences.
[1]