Leg cramps solution?

Brandy

Anyone find a solution to reduce leg cramps? I started taking magnesium since that's more likely to be helpful compared to potassium. I've also been using a foam roller on my legs before bed. Yet, I still sometimes get painful leg cramps in the middle of the night that keep me up.