This is Dr. David
you could be having low blood potassium levels or low blood magnesium cause cramps in your legs at night time.
dehydration can do this as well.
you may need to drink more fluid and get more potassium and magnesium into your system.
have you had your potassium or magnesium levels checked?
exercise can deplete potassium out of your system.