A variety of medical conditions and some activities can cause muscle spasms.
Knowing the cause can help you to prevent them from occurring.
An electrolyte imbalance is one cause. Low potassium and calcium levels are the culprit. Vitamin and mineral supplements can correct this condition.
Problems with circulation such as suffering with peripheral artery disease can be another cause. Certain medications, such as diuretics, statins, and steroids can cause muscle cramps. Being dehydrated is another possibility.
Exercise, injury or overuse of muscles is a possible cause. Standing on a hard surface for a long time, sitting for too long, or putting your legs in awkward positions while sleeping can cause your muscles to cramp.
You can stop a muscle cramp by stretching and massaging the muscle. Try soaking in a warm bath or placing a heating pad on the affected area. Conversely, using an ice or cold pack might give you relief. Always keep a cloth between your skin and the ice pack. Keep hydrated by drinking plenty of fluids. Unless contraindicated, sport drinks will often help with leg cramps.
All the best,