rack your brains
rack (one's) brain(s)
To struggle to recall or think of something. I've been racking my brain, but I still can't remember what Lydia's husband's name is. He racked his brains all weekend trying to think of a solution to the problem.
See also: rack
rack your brainsor
rack your brain
COMMON If you rack your brains or rack your brain, you think very hard about something or try very hard to remember it. She racked her brains but could not remember enough to satisfy the clerk. They asked me for fresh ideas, but I had none. I racked my brain, but couldn't come up with anything. Note: The old-fashioned spelling wrack is occasionally used instead of rack in this expression. Bob was wracking his brain, trying to think where he had seen the drivers before. Note: You can refer to this activity as brain-racking. All your brain-racking is making absolutely no contribution to the world.
rack your brains (or brain)make a great effort to think of or remember something.
A rack was a medieval instrument of torture consisting of a frame on which a victim was stretched by turning rollers to which their wrists and ankles were tied. To rack someone was to torture them on this device and the image in this idiom is of subjecting one's brains to a similar ordeal in the effort to remember something.
1998 Spectator If I rack my brains for something nice to say about our weather, I suppose it does at least enable us to grow better grass than they do in California.