The reasons for sleeping with sore legs are as follows: first, it may be caused by muscle strain, such as a large number of sports during the day, which will cause a large accumulation of lactic acid in the thigh or calf. In the quieter state at night, you tend to feel the soreness and pain of the calf muscles. Secondly, it may be caused by calcium deficiency, calcium ions can inhibit the excitability of neuromuscular junction, when calcium deficiency, the excitability of neuromuscular junction will be increased, often manifested as twitching of hands and feet. In adults, it is mostly manifested as spasmodic pain in the gastrocnemius muscle at night, that is, calf cramps, which can be manifested as calf pain, or calf soreness and swelling sensation. Thirdly, we should also consider vascular diseases, such as lower limb occlusive vasculitis, lower limb varicose veins, lower limb venous thrombosis, which can cause soreness and swelling of the legs at night.