What’s wrong with the legs that always shake a lot when you sleep?

Legs that always shake frequently during sleep may be periodic limb movement disorder, a recurrent episode of highly stereotyped limb movements during sleep, also known as periodic leg movements because they often occur in the lower extremities. The cause of this condition is not well understood, and the presence of a family history of restless legs syndrome is considered a risk factor for periodic leg movements. There are a number of medications that can also contribute to the development of periodic leg movements, such as selective 5-hydroxytryptamine reuptake inhibitors, tricyclic antidepressants, or some lithium agents that can induce or exacerbate periodic leg movements, and iron deficiency in the brain that can exacerbate periodic leg movements during sleep through the effects of iron on the dopamine system. There is evidence that obstructive sleep apnea syndrome, sleep deprivation, pain, and alcohol intake may exacerbate the occurrence of periodic leg movements during sleep.