Nocturnal leg cramps get more common as one grows older. The exact cause is not known, but may include electrolyte imbalance.