A sudden involuntary contraction in the leg muscles often gives rise to painful cramps. Some of the probable causes can be as follows:
Dehydration caused from strenuous physical workouts or laborious jobs is one of the prime causes of leg cramps.
Insufficient supply of blood to your legs owing to narrowing of arteries, a condition called arteriosclerosis.
Compression of nerves in the spine.
Depletion of potassium, calcium and sodium levels caused by taking diuretics.
Loss of muscle mass owing to aging.
Shortage of carbohydrate
Trauma or any injury
Underlying medical conditions like diabetes or problems in liver and thyroid.
Image courtesy: https://heartpulsediseases.wordpress.com