Sarah Jessica Parker was convinced her ex-boyfriend Robert Downey Jr. would die from a drug overdose.

Sarah Jessica Parker

Sarah Jessica Parker

The 'Sex and the City' star dated the 52-year-old actor from 1984 until 1991, when his addiction drove a wedge between them, and she remembers walking away and praying that his habit wouldn't prove fatal.

She said: "I learned how to take care of myself.

"There was a huge amount of time spent making sure he was OK. At a certain point, I had the courage to say, 'I'm going to walk away and I'm just going to pray that you don't die.' "

The 52-year-old actress has admitted she "didn't know" about the 'Iron Man' star's addiction, which included heroin and cocaine, for a "long time" but she regularly questioned why his heart was beating so fast.

Speaking to People magazine, she explained: "I was like, 'Why is his heart beating so fast? Don't do so many pushups before bed!' ... but I will say, I don't regret any of it. I don't resent the time spent."

And that wasn't the only time she was left with a broken heart as prior to meeting Robert, she fell in love with her 'Footloose' co-star, the late Chris Penn, in 1984 and was left devastated when they split up.

She recalled of working on the classic movie: "It was heavenly because, first of all, it was Kevin Bacon. I'd gone to the movie theater like 11 times to see 'Diner'. And there I was, working with him. And I fell in love with Chris Penn.

"I learned that it's great to have your heart broken. I hated it, it was miserable. But getting your heart broken is necessary. You know that you can love somebody and you have resilience."

Sarah then went on to find love with her husband Matthew Broderick, with whom she has James, 15, and eight-year-old twin girls Tabitha and Loretta, and the pair have been married since 1997.

She explained: "It seems so silly, but I think you're very lucky if you like the person. I still just really like him. I'm sure I annoy him and he annoys me, but I literally learn about him every day. I'm like, 'You're doing what? You're reading what?' I think marriage has a lot of vitality. If you're fortunate, it's like this dazzling organism."