Flowers are placed in memory of actor/comedian Robin Williams on his Walk of Fame star in the Hollywood district of Los Angeles, Monday, Aug. 11, 2014. Williams, a brilliant shapeshifter who could channel his frenetic energy into delightful comic characters like "Mrs. Doubtfire" or harness it into richly nuanced work like his Oscar-winning turn in "Good Will Hunting," died Monday in an apparent suicide. He was 63. Williams was pronounced dead at his San Francisco Bay Area home Monday, according to the sheriff's office in Marin County, north of San Francisco. (AP Photo/Kevork Djansezian)

NEW YORK (AP) — Jamie Masada, the owner of the fabled Los Angeles-based comedy club the Laugh Factory, vividly remembers a warm exchange with comic Richard Jeni of the two sharing words of encouragement and gentle ribbing.

“The next day I heard he put a gun in his mouth and blew his head off,” recalled Masada of Jeni’s 2007 suicide. “At that point I said, ‘God, could I do something to somehow prevent that?'”

A few years later, having watched his “family” continuously depleted, Masada did do something. He began having a psychologist at the club several nights a week, offering stand-ups the opportunity for free sessions.

Robin Williams, a frequent Laugh Factory performer who committed suicide Monday, marked only the latest comic genius to be plagued by demons of depression and addiction. But seldom has the gulf between the bright buoyancy of the performer and the inner pain of the man seemed greater or more unfathomable. How did someone who suffered such demons summon such starbursts of generosity and glee?

Like countless others this week, Conan O’Brien remembered Williams’ great capacity for thoughtfulness and kindness. When O’Brien was feeling down during the “Tonight Show” debacle, a bike arrived out of the blue from Williams, outfitted for maximum ridiculousness. Said O’Brien: “It’s particularly courageous for someone to be that generous of spirit in the face of that kind of depression.”

Such tales don’t make it any easier to reconcile Williams’ life with his sad fate. The magnitude of the shock over Williams’ death has been matched only by the outpouring of grief for his loss. “I’ll never, ever understand how he could be loved so deeply and not find it in his heart to stay,” said his 25-year-old daughter, Zelda Williams. “He was always warm, even in his darkest moments.”

Williams’ publicist has said he had recently fought severe depression. Williams himself had occasionally spoken about his struggles (“Do I get sad? Oh yeah. Does it hit me hard? Oh yeah,” he told Terry Gross in 2006) and funneled his fights with alcoholism and addiction into his act. He largely won his battles with substance abuse except for several relapses quickly followed by rehab, including a stint at Hazelden in Minnesota last month. His widow, Susan Schneider, added Thursday that Williams also was suffering from the early stages of Parkinson’s disease.

Those factors — along with his heart surgery several years ago — offer a slightly deeper understanding of Williams’ mental state in recent days and weeks. But his death also reinforces the long-held stereotype of the sad clown, the tortured funnyman.

Comedian Jim Norton responded to Williams’ death with an essay titled “Why the Funniest People Are Sometimes the Saddest” in which he noted that in his 25 years of performing stand-up, he knew eight comics who killed themselves.

“When I find a comedian I admire, my first thing is: What’s wrong with this person?” Norton says. “Guys that I’ve admired the most always had that cloud. And it wasn’t a purposeful or a pseudo-artist thing. It was a real thing that they were constantly combating. It was kind of a way to keep sadness or depression off of you, to be funny.”

Particularly since the likes of Lenny Bruce and Richard Pryor made stand-up into a more personal kind of truth-telling, many comedians have been drawn to the profession as a means for catharsis. Comedian Tig Notaro pushed stand-up perhaps further in this direction than ever before in a famous set in 2012. Days after being diagnosed with breast cancer, she hit the stage: “Hello. I have cancer. How are you?”

Nowhere has the intersection between comedy and psychological pain been more thoroughly plumbed than on Marc Maron’s podcast, which Maron began after he had suicidal thoughts. In lengthy, candid interviews with fellow comics, Maron has explored the often-troubled psychology that drives people to bare themselves before crowds night after night, feeding off the laughter.

Maron’s conversation with Williams from 2010 is one of his most naked interviews. In it, Williams called stand-up “the one salvation” and commented: “How insecure are we, how desperately insecure that (it) made us do this for a living?” He even riffed on his suicidal urges, doing a two-man routine between himself and his consciousness. Replaying the episode this week, Maron reflected: “He was a person with his own problems that he carried with him. And I think part of his genius came from the struggle with those problems.”

Studies have shown a correlation between creative minds and such problems. Nancy Andreasen, a leading neuroscientist and psychologist, co-wrote the first empirical study that proved the increased likelihood of mood disorder in creative people.

“There really is no question that there’s a statistical correlation of mental illness in highly creative people,” said Andreasen, who chairs psychiatry at the University of Iowa. She stressed, though, that mental illness is usually treatable — “It’s not a lifetime sentence,” she said — and that treatment “does not diminish their creativity.”

“The great misfortune is that mental illness is still so stigmatized,” said Andreasen, lamenting the lack of care for the mentally ill. “This probably could have been prevented, and it’s a terrible misfortune that it wasn’t.”

A recent study published in the British Journal of Psychiatry found that comedians are both highly extroverted and highly introverted and that they even show lower levels of traits associated with psychosis.

“Humor often requires the ability to ‘think outside the box’ or see unusual connections where others don’t, and this reflects, in a more muted form, the thought process and pattern seen in psychosis,” Victoria Ando said in an email.

But depression also doesn’t care what you do for a living. It can strike anyone, any time, regardless of success, income or fame. In “The Noonday Demon,” an award-winning, multi-disciplinarian “atlas” of depression, author Andrew Solomon wrote that his own depression hit hardest when his life was most in order: “All the excuses for despair had been used up,” he wrote.

Solomon says he hopes Williams’ tragic end serves as a “wake-up call.”

“We have to recognize that if you have depression and enormous wealth and success, the love of most of the people in America — you can have all of those things and still be subject to the ravages of depression,” Solomon said. “The tragedy is that he didn’t have any place to turn.”

Improv and sketch comic Chris Gethard has been particularly vocal about his own struggles with depression with the hope of helping others. Following Williams’ death, he posted a picture of himself taken after an earlier day spent crying in bed, labeling it: “This is the face of my mental illness.”

“All kinds of people get depressed — comedians just happen to be people that professionally deal with the manipulation of happiness, laughter and other positive emotions, so maybe it stands out more or gets more pronounced,” Gethard said.

Perhaps Williams’ death shouldn’t just be added to the sad list of comics who died too young, like John Belushi or Chris Farley, but should be taken as a lesson by the rest of us, the ones in the audience below the floor lights, that we should listen just as keenly to Williams in death as we did to him from the stage.

“It is our hope in the wake of Robin’s tragic passing that others will find the strength to seek the care and support they need to treat whatever battles they are facing,” said Schneider, Williams’ widow, “so they may feel less afraid.”