Strenuous physical activity, especially prolonged use of the leg muscles, can cause swelling. Such overuse can lead to muscle fatigue and cramps at rest, such as at night. Activities such as running, cycling, and even standing for long periods of time can contribute to this. In some cases, even a small amount of exercise in an untrained person can cause cramps during sleep.
Sedentary lifestyle Conversely, lack of physical activity can lead to nighttime pain. Infrequently used, stretched muscles shorten and tighten over time. When these muscles are suddenly activated during sleep, there is a lot of pain. People who sit for long periods of time, such as desk workers, are more prone to these cramps.
Improper sleeping position Certain sleeping positions can contribute to cramps, such as pointing your toes down and keeping your legs in an uncomfortable, restricted position for long periods of time. Constant muscle contractions or awkward angles can cause muscles to spasm suddenly.
Pregnancy Many pregnant women experience leg pain at night, especially during the second and third trimesters. The exact cause is not fully understood, but changes in blood circulation, weight gain, and increased pressure on the nerves and muscles of the legs are thought to contribute to swelling. Hormonal changes and increased fluid retention can lead to electrolyte imbalances and cramps.