Soreness and swelling of legs while sleeping can be caused by a variety of diseases. The common one is poor venous reflux in the lower extremities, such as deep vein thrombosis, etc. Patients often have obvious calf soreness and swelling, and some of them have swelling in the lower extremities, which can be clearly diagnosed by performing lower extremity venous ultrasound examination. In addition, when the lumbar intervertebral disc herniation or bulge causes nerve compression, the soreness and swelling of the lower limbs will also appear, because the pain threshold is lower at night rest, so the soreness and swelling is more obvious. If the leg is sore and swollen after sleeping, you can take oral NSAIDs, promote venous return and improve microcirculation medication, which can gradually reduce the symptoms. If the effect of oral medication is not good, you should go to the hospital in time to perform the necessary tests to clarify the diagnosis and carry out targeted treatment.