Feeling sore legs while sleeping may be caused by physiological reasons such as excessive exercise and cold stimulation, or it may be caused by pathologic factors such as lumbar intervertebral disc herniation and vascular diseases of the lower extremities. 1. Physiological reasons: excessive exercise of the legs will lead to anaerobic metabolism of the leg muscles, resulting in the accumulation of lactic acid locally, and the symptom of sore legs may appear when resting; secondly, keeping the legs in one position for a long time may lead to leg fatigue, and the above symptoms may also appear. In addition, people who do not pay attention to keep warm in winter and often blow air-conditioning in summer will lead to spasm of small blood vessels in the legs, which may also lead to the above symptoms. 2. Pathological factors: when lumbar diseases press on the nerves, it will cause sensory and motor dysfunction of the muscles in the innervated area, which may also lead to soreness of the lower limbs when sleeping, such as lumbar disc herniation, spinal stenosis, etc. Lower limb vascular diseases affect the blood circulation of the whole lower limb, and the above mentioned symptoms may occur, such as varicose veins of the lower limb, deep vein thrombosis, etc. If the symptoms occur after lifestyle modification, the symptoms may also appear. If the symptoms are not relieved after lifestyle modification, you should consult a doctor in time to clarify the cause of the disease and under the guidance of the doctor.