1) Straighten the leg, flex the foot upward toward the knee, or grab the toes and pull them toward the knee.
2) Walking or shaking the affected leg, then elevating it, may also help.
The exact cause of cramps is not well understood, but there are some risk factors that are thought to contribute to this condition:
1) Muscle fatigue,
2) Heavy exercising,
4) Over weight
5) Electrolyte imbalances,
6) Vitamin deficiency,
7) Age above 60.
The medical causes related to the disease process are;
1) Calcium and phosphorus imbalances can cause cramping.
2) Low potassium or sodium (salt) levels.
3) Deficiencies of a nutrient called hesperidin, an antioxidant flavonoid found in oranges and other citrus fruits, have also been linked to nocturnal leg cramps.
4) Overexertion, standing on concrete for long periods, or prolonged sitting (especially with the legs contorted) may contribute to nighttime cramps.
5) Having structural disorders in the legs or feet (such as flat feet) may increase the risk for cramps.
6) Among the many medical causes of muscle cramping include hypothyroidism, Addison's disease, uremia, hypoglycemia, anemia, and certain medications.
Please feel free for your follow up questions.
I would be happy to assist you further, if you need any more information.