It is more frequent when I'm half asleep than when I'm awake and able to catch it before it goes too far. Aside from the excruciating pain at the time, I'm also left with a calf that is sore to touch and painful to extend fully, sometimes for several days afterwards.
Yup. Dehydration and/or too much salt.