My husband has this awful affliction ...drives him nuts and sometimes his legs jerk so badly I think he is fitting .
went to doctor and got meds for it [lower dose of meds used for parkinsons disease but no link to that illness must add ] .......works very well indeed .
I think it is linked to dopamine levels in the brain so can see why so many of us suffer from it . it makes sleep impossible I know.....horrid .
also he avoids too much exercise at night and hot baths before retiring and uses a pillow to prop his legs up . hope this helps xx