turn (something) over in (one's) mind
To think about something continuously; to give something one's close and undivided attention. I've been turning over the problem in my mind for days, but I still haven't figured out a way to make the numbers work. You're going to drive yourself crazy if you keep turning over that encounter in your mind—you just have to let it go.
turn something over in one's mind
Fig. to think about something. I have to turn your suggestion over in my mind a bit before I decide what to do. After Alice had turned the matter over in her mind, she gave us her verdict. Please take some time to turn over this matter in your mind.