Your mind is for having ideas, not holding them.
—David Allen, GTD for Teens
The more I hold in my head, the more my head flips around between thoughts, the less focused I am, the less productive I am.
Just write the thought down, bring it to a (temporary) closure, and focus on the task at hand.