It is a bit of an old wives tale, but it worked for me... Have a glass of milk and a banana before you go to bed - the milk for calcium and the banana for potassium.

On the nights that I remembered to do it I never got a leg cramp, but did on the nights that I forgot. Mind you, by the sounds of things mine weren't as bad as yours.

GL, I hope this gives you a little bit of relief or somebody else has a better suggestion