I was going to suggest this, as well. Eat one before bed. If you don't get the cramps, you'll know it's postassium.
Also - are you drinking enough water during the day? Are you having a 'night cap' before bed? I find if I have a glass of wine too close to bedtime, I'll cramp up. Dehydration?? I dunno...