In recent years the University of Notre Dame in Indiana made a study on the effect of “event boundary” and the cause of memory lapse. The researcher Gabriel Radvansky was able to explain the phenomenon every person experiences at least once in their lives.
Radvansky discovered that just passing through a doorway creates an “event boundary” in the human mind. This means that the boundary is separating episodes of activity in the brain and storing them away. In other words, crossing the doorway puts a barrier between the action you were doing (or thinking about) and the one you’ll be doing once you pass through the doorway. This boundary effect is the reason why sometimes we can’t remember why we’ve entered the living room or the kitchen.
The “event boundary” effect is something very common and it doesn’t mean something’s wrong with your brain or memory function. It just means that sometimes you’ll need to work hard in order to remember what you were about to do before you entered the room.