It's a common Hollywood trope -- an older guy is having enthusiastic sex with a gal half his age when he suddenly flops over dead.

But in real life, sexual activity very rarely causes cardiac arrest, a new study reassuringly reports.

Sex was linked to only 34 out of more than 4,500 cardiac arrests that occurred in the Portland, Ore., metropolitan area between 2002 and 2015. That's a rate of just 0.7 percent, the researchers noted.

Get Breaking News Delivered to Your Inbox

Of those cases, 18 occurred during sex and 15 immediately after sex. Time couldn't be determined for the last case.

"I'm a little surprised at the really tiny number," said study senior researcher Dr. Sumeet Chugh, medical director of the Heart Rhythm Center at Cedars-Sinai Medical Center in Los Angeles. "But mostly I feel it's reassuring data."

The news is most welcome for patients with heart problems who aren't sure if sex could be dangerous, Chugh said.

"Previously we would say the risk is probably low, but we don't know how low," Chugh noted. "Now we have data and we can say to them the risk is very low."

The new findings are part of a 16-year study of heart risk factors involving about a million people living in and around Portland.

"Sexual activity is just one variable in the whole big picture" of cardiac risks, but one that hasn't been studied in depth, Chugh added.

Men are more likely than women to have their heart stop as a result of sex. Just two of the 34 cardiac arrest patients were female, the findings showed.

But overall, sex was linked to only 1 percent of all cardiac arrests that occurred in men.

Other heart experts said they weren't surprised by the results.

Sex just isn't as strenuous as people believe. The aerobic activity associated with sex is equivalent to climbing two flights of stairs, explained Dr. Nieca Goldberg. She is director of the NYU Center for Women's Health and an AHA spokeswoman.

Dr. Martha Gulati, chief of cardiology for the University of Arizona College of Medicine, said, "Although a lot of us think sex requires an intense level of activity, even in the most extreme situations it's not as intense as people imagine it."

The safety of sex comes up from time to time with patients who've suffered a heart attack or have been diagnosed with a heart problem, Goldberg and Gulati said.

Sex generally is safe for most heart patients, unless they are unable to maintain even low levels of activity or have symptoms that keep them from doing daily chores like making the bed or cleaning the house, the heart experts noted.

Goldberg suggested that "doctors really should be discussing this information with their patients to allay their fears they may have after a cardiac diagnosis, that most people return safely to having sexual activity."

There's one silver lining for people who have a cardiac arrest from sex -- they're almost twice as likely to survive, Chugh said.

About 19 percent of the patients in sex-related cardiac arrest cases survived their ordeal, compared with an average survival rate of around 10 percent nationwide, he said.

"By now, there is recognition from a lot of research that if someone is around when you have your cardiac arrest and provides CPR while the ambulance is getting there, it can be potentially lifesaving," Chugh said. "You're pretty much guaranteed to have a witness if sexual activity is involved."

Yet only one-third of those witnesses in the study attempted CPR, which suggests a continuing need for public education on the importance of CPR, the study authors noted.

The study is scheduled to be presented Sunday at the American Heart Association's annual meeting in Anaheim, Calif. It will also be published simultaneously in the Journal of the American College of Cardiology.