What is the problem of leg pain in sleep?

Sore legs while sleeping may be due to excessive leg activity during the day or standing for too long, resulting in a build-up of lactic acid in the legs, which stimulates the leg muscles and produces sore legs; it may also be due to a strain on the leg muscles caused by daytime activities, causing a sore feeling in the legs.