I think that there is medication you can have if things are really bad. My dad used to get this and his legs would kick out when he was asleep - my mum was always trying to get him to go to the doc about it but, being rather stubborn and not awake himself when it happened, he never did.
Taz x