Do you ever go into another room for a specific reason only to find you've forgotten what that reason is, even if only for a moment?
This is known as the Doorway Effect, and a vast majority of people have experienced the Doorway Effect at one time or another in their lives, if not on a daily basis, and it means your mind is working just fine.
The Doorway Effect is thought to be a way for our brains to pay attention to new details and free up memory space for new information:
A 2011 study found that the Doorway Effect is the result of several of these brain programs running simultaneously. Researchers taught 55 college students to play a computer game in which they moved through a virtual building, collecting and carrying objects from room to room. Every so often as the participants traversed the space, a picture of an object popped up on the screen. If the object shown was the one they were carrying or the one they had just put down, the participants clicked “Yes.” Sometimes these pictures appeared after the participant had walked into a room; other times they appeared while the participant was still in the middle of a room. The researchers then built a real-world version of the environment and ran the experiment again, using a box to hide the objects people were carrying so they couldn’t double-check.
The results of both trials were the same: The simple act of walking through a doorway made people forget what they were doing. And it wasn’t a matter of distance, either. The researchers asked the question (“Is this what you’re carrying?”) after people had walked a certain distance within a room, and a certain distance between rooms. Within a room, their memories remained mostly intact. But crossing a threshold was like shaking a mental Etch-a-Sketch.
The researchers concluded that their subjects’ brains perceived doorways as a kind of cut-off point. The memories and movement that carried the students through one context literally hit a wall. On the other side of that wall was new context, and a fresh landscape for memory. The participants’ mental computers were combining the tasks of spatial awareness, movement, and memory. But each task requires attention, and you can’t pay attention to everything at once.
-Via Mental Floss