BANANAS - lots of! 4 me it's lack of potassium. Some find they need more magnesium.
I suffered intermittently for years. I would lay with my legs up but of course, when dropping off to sleep the legs would drop too. I've hung them over the edge of the bed. I was advised by NAPS to eat every 3 hours and included bananas in my diet, within 5 nights the sensations had disappeared. I ate bananas daily for the next 5-6 years with no return of symptoms.
If I find them pulling as I get into bed I take 2 Nurofen. That helps. It can be a destroying condition.