racking
v.v. to cause great physical or mental pain to someone. It is often used when you are trying very hard to remember something or solve a difficult problem.
v. to subject someone or something to extreme physical or mental suffering. Frequently used in the figurative sense of straining one's mental faculties to achieve a result.
I am racking my brain to remember where I left my keys.
The detective spent the entire night racking his memory for any detail that might identify the suspect.
While the physical pain was racking his body, he remained focused on the task of ensuring his companions reached safety before the storm intensified.
Commonly appears in the fixed idiom 'racking one's brain'.
wracking my brainracking my brainWhile 'wrack' is increasingly common, 'rack' is the historically correct spelling for the sense of stretching or straining.