Circulatory problems could also cause leg cramps while sleeping because of the poor or reduced supply of oxygen to the muscle and tissue. Nocturnal cramps can affect anyone from any age group. However, in most cases, it affects people with poor circulation in their limbs especially pregnant or elderly women.