Hi, I'm dr.Fahad Khan . i have reviewed your case and I'll try my best to be helpful.
First of all i need to know that what sort of activities you do during the day , are you pregnant?(if you are a female ,as you haven't mentioned your gender) , do you have a long standing job?
They might be "nocturnal leg cramps".
Try these precautions,they might be very helpful.
Make sure that you stay hydrated—drink six to eight glasses of water each day.
Gently stretch your leg muscles before you go to sleep.
Keep blankets and sheets loose around your feet so that toes are not distorted.
Forcefully stretching the affected muscle is usually the most effective way to relieve the cramp. You might be able to relieve the cramp by walking around, jiggling your leg, or massaging the leg. Warm baths or showers may be helpful. Alternatively, applying ice has also shown some benefit.
Vitamin E supplements or Vitamin B complex may be helpful.
Magnesium supplements have also shown some benefit, mostly in pregnant women.
Regards.