Nutrient deficiencies, particularly low magnesium, calcium, or potassium, may play a role in muscle cramps. Nerve compression in the lower back can also radiate pain to the legs. Finally, your sleeping position matters. Sleeping with toes pointed downward can shorten calf muscles and trigger a cramp. Try keeping your feet flexed upward.









