Researchers reviewed the medical charts of 832 consecutive patients seeking help at a Toronto sleep center and found that 63 patients, or 7.6 percent, reported either having had sex or engaging in other sexual activity, like masturbating, while asleep.

The phenomenon, called sexsomnia, is a form of parasomnia, a disorder in which people who are asleep but in a state of semi-arousal engage in behaviors they are not conscious of. Sexsomnia is defined by the International Classification of Sleep Disorders and may take place during a sleepwalking episode.

The study, which has not yet been published, is among the first to try to quantify how prevalent sexsomnia is among patients with sleep problems. (An abstract was to be presented Monday in San Antonio at Sleep 2010, the annual meeting of the Associated Professional Sleep Societies.)

The author, Sharon A. Chung, a scientist at the Sleep Research Laboratory at Toronto Western Hospital, says the behavior becomes a problem when it disrupts the normal sleep cycle.

“At night you’re supposed to be sleeping,” she said in an interview. “Anything that stops you from sleeping at night is bad — not because of the behavior, because it stops you from sleeping.”