It was early in her acting career, but already Portia de Rossi seemed to have it all.

The Australian actress, who'd begun her life in the spotlight as a model at age 12, landed a role in 1998 on the hit ABC series "Ally McBeal" at 25, and was cast in a leading role in a major motion picture two years later. Tall and slender, with a mane of blond hair, she looked on the outside to have an ideal life.

On the inside, it was anything but ideal.

In 2000, she collapsed on the set of "Who is Cletis Tout?" At 5 feet 8 inches, she weighed 82 pounds, the result of a regimen in which she ate only 300 calories a day and exercised unrelentingly.

She was hiding a secret she thought would ruin her career prospects -- that she was a lesbian -- and was ashamed of her lie. She thought if she were thinner, she'd be more beautiful, more accepted and more successful.

Instead, she came close to organ failure and was diagnosed with osteoporosis and lupus. Her eating disorder yo-yoed in the other direction, and 10 months later, she weighed 168 pounds. She found equilibrium with friends' support and therapy at Malibu's Monte Nido treatment center.

Now, the 37-year-old actress, who weighs 130 pounds, has written a memoir, "Unbearable Lightness: A Story of Loss and Gain" (Atria Books, 308 pages).

In excruciating detail, she lays bare the thought processes driving her anorexia, the rituals she developed around eating food and the intense feelings of worthlessness she couldn't shake.

It was cathartic, she said, to explore why she turned to anorexia.

"I wanted to starve away my sexuality," she said in a 40-minute phone interview from the farm outside Los Angeles where she spends weekends with her wife, Ellen DeGeneres.

"I wanted to disappear. I didn't want to be attractive. Once I realized that starving would lead to sickness and possibly even death, I thought I could disappear just as easily being overweight as underweight."

She was concerned the book's revelations might spur copycat behavior, but went ahead anyway.

"I felt like if I was going to tell the story, I had to be 100 percent honest about it," she said. "I wanted people to understand what it's like in the mind of a person with an eating disorder.

"From the outside, it can seem strange. In fact, it's a logical progression that starts with the best of intentions -- being healthy, the best you can possibly be. It takes a turn somewhere."

De Rossi, born Amanda Rogers, was a straight-A student who wanted to excel in everything. She started modeling at 12 to make herself "feel attractive," but it did the opposite.

"I had individual body parts being compared to other girls'," she said. "Everything was a contest."

She started bingeing and purging to mold herself to the shape clients wanted. Fearful that her real name was "too ordinary," she changed it at 15 to something "more exotic." At 18, she realized she was a lesbian. She tried to change that, too.

De Rossi went to law school briefly, then became an actress and moved to Los Angeles, where she was married briefly to a man.

When she won the role of Nelle Porter on "Ally McBeal," her time on the treadmill -- literally, not figuratively -- began.

In the morning, she'd run 60 minutes at an eight-minute, 34-second mile pace. Her breakfast was 60 calories' worth of plain oatmeal, sprinkled with Splenda and misted with butter-flavored cooking spray. She skipped lunch and ran again on a treadmill in her dressing room with a fan blowing her face to keep her makeup dry.

Dinner consisted of 2 ounces of tuna (from a 6-ounce can divided in thirds) eaten with chopsticks in tiny bites. She smoked after eating to help feel full.

But her insecurity was running high. One day, she cried after eating 6 ounces of yogurt instead of the 2 ounces she'd allotted. She writes:

"It crosses my mind to vocalize my thoughts of self-loathing, because speaking the thoughts that fuel my sobs would have to burn more calories than just thinking the thoughts and so I say, 'You're nothing. You're average. You're an ordinary, average, fat piece of ... You have no self-control. You're ... stupid, fat, disgusting.' "

When cast for the show, she weighed about 130 pounds. By Christmas 1999, she weighed 89 pounds. Her family in Melbourne was stunned. De Rossi still thought her thighs were too big. Her brother cried. So did her mom, prompting de Rossi to apologize for being gay and making her mother ashamed of her. Her mother denied it at first, then owned up to it, called herself "a stupid old fool" and told her that she loved her.

"I felt the weight fall away from me. I lost the weight that I'd been carrying around since I was a teenager. Shame weighs a lot more than flesh and bone."

But her literal weight loss continued, and the collapse on the movie set occurred the next year. Her health began to improve once she sought treatment and moved in with a woman whose normal eating patterns she began to emulate.

De Rossi also was outed by a paparazzo, but instead of hurting her, it released her from her secret, she wrote. De Rossi met DeGeneres in 2001; they became a couple in 2004 and wed in 2008.

Today, food is not a problem, even on Thanksgiving.

"I don't give food a second thought unless I'm really hungry or craving something," de Rossi said. "Restrictions generate yearnings. I start restricting, I overeat."

The actress, who went on to appear in the cast of Fox TV's "Arrested Development" and ABC's "Better Off Ted," is hoping the book will shed light on the pain that comes with hiding one's sexual orientation.

"Believe it or not, I forgot that the reason I was chosen for a role is because I could play it well," she says. "I thought it had more to do with how I looked than my talent.

"When I got on 'Arrested Development,' I thought, 'I have to be funny, I have to be good. I have amazing dialogue to say and a character to play, instead of just trying to be attractive.' That was a bit of a turning point for me, seeing myself as an actress instead of a girl who got lucky on a TV show full of pretty girls. And coming out was a turning point. Once I felt OK about it ... felt proud of being gay, felt good about being gay, coming out and saying it and being public about it, it changed my life instantly and made me respect myself and like myself."

The National Institute of Mental Health estimates that 0.6 percent of adults in the United States will experience anorexia in their lifetimes; 1 percent will suffer from bulimia; and 2.8 percent from a binge eating disorder.

The number of people 18 or older was estimated at 230 million in 2009, according to the U.S. Census Bureau.