There’s no better advertisement for nursing homes than Kenneth Lonergan’s play “The Waverly Gallery,” first produced in 2000 and now revived on Broadway, where it opened Thursday at the Golden Theatre.

The playwright has called it a “memory play,” and this early autobiographical work owes much to “The Glass Menagerie.” In “The Waverly Gallery,” the young writer Daniel Reed (Lucas Hedges) is overwhelmed with guilt regarding the care for his aging and increasingly demented grandmother Gladys (Elaine May), who has long run an art gallery in Greenwich Village.

But unlike Tennessee Williams’ Tom Wingfield and his fraught relationship with a difficult mother, Daniel never abandons Gladys. Then again, he’s not there for her as much as he thinks he should be, leaving his grandmother alone in her apartment for hours on end even though she lives next door. His anguish only intensifies because, increasingly, the problem of caring for Gladys falls to his mother, Ellen (Joan Allen), who is Gladys’ very distraught daughter.

May brings her comic genius to the role of Gladys, and that very off-center, always marvelously skewed approach to the text goes a long way toward making the character much less of a trial for us in the audience than she is supposed to be for the characters around her.

But she is a trial nonetheless, what with her acute deafness, her repetition of stories and her nonsensical segues. Long after Gladys is a clear danger to herself, either running the gallery or living alone, Lonergan attempts to drum up some much-needed suspense and moral outrage when the landlord wants Gladys to vacate the gallery in a few months time. He’s turning the space into a café for his hotel.

While we’re supposed to be upset for Gladys and her family — what is she going to do without her gallery? — this unseen landlord is clearly the only person in Lonergan’s play who has a grip on reality. Gladys needed to be put in a nursing home years ago.

Lonergan doesn’t so much dramatize what little story there is as have Daniel tell us that story. As this young man explains it, his family doesn’t put Gladys in a nursing home because she doesn’t like old people. But does she like being alone all day in her apartment during the cold winter months when she can’t get to the gallery? Or being screamed at by her frustrated daughter and grandson?

What’s absent in Lonergan’s text is more than hinted at in Allen’s commanding performance. May, as always, is benignly mad on stage. Like many gifted comics, she is a great actor but not a transformational one. Allen, on the other hand, is. And she miraculously melds herself into being May’s daughter without ever resorting to mimicry.

As crazed as she is by Gladys’ disintegration, Allen’s Ellen sees her own future awaiting her there. Forget that Ellen tells her son she’d rather put a bullet in her head than end up like her mother. Allen makes it clear that Ellen’s relentless care for Gladys is a subtle lesson to Daniel.

Who can fault the playwright for the way he remembers his own grandmother? But missing from these characters’ reaction to Gladys is that automatic pilot that caregivers often resort to in order to cope. Instead, Lonergan’s characters never stop trying to communicate with the increasingly incommunicable Gladys. Perhaps that’s how they show their love. Certainly, screaming at her in pent-up rage is more theatrical than ignoring her.

One exception is Ellen’s second husband and Daniel’s stepfather, Howard, who simply yells at Gladys without ire and is played with great detached humor by David Cromer (now also represented on Broadway with his direction of “The Band’s Visit”).

Michael Cera, who starred earlier this year in the Broadway revival of another Lonergan play, “Lobby Hero,” rounds out the starry cast. He plays Don from Massachusetts, the last artist to have a show in Gladys’ gallery. Don’s scenes hint at what Lonergan would become as a screenwriter and playwright. (His “Hold on to Me Darling” was the best play of 2016, in my opinion.)

Also, Cera grounds his scenes with the lightest of touches. Especially poignant and amusing is the family’s description to him of the much younger Gladys. Their anecdotes go on too long — Don is a virtual stranger, after all — but they capture a lost, eccentric and beautiful life. Later in the play, Lonergan reverses the situation when this failed artist unloads his grief on Daniel and Ellen at exactly that moment when, moving Gladys out of her apartment, they least want to hear from him.

In his Broadway debut, Hedges is nicely understated in delivering Daniel’s ironic take on life. His big moments of frustration, however, may be a little too big. It’s also disappointing to see one of those little body-mic wires crawling out of the back of his T-shirt and up into his scalp. The Golden Theatre is only 800 seats. Broadways plays have long been sonically enhanced, but are body mics needed even in such an intimate space?

Lila Neugebauer directs the excellent performances. Less wonderful is her use of David Zinn’s impressively worn and ordinary sets, which require way too much time to change. A brick wall drops in between scenes and filmed segments of street life in a lost Greenwich Village are projected on that facade. The moving images give off a nostalgic glow in the beginning, but soon develop an anonymous fuzziness. Years ago, a Second Stage production of “The Waverly Gallery” divided the stage into the living room and the gallery, and the actors quickly walked from one space to the other. It worked.

17 Top-Grossing Broadway Musicals of All Time From 'Hamilton' to 'The Lion King' (Photos)

HOLLYBLOGS

Robert Hofler has worked as an editor at Life, Us Weekly and Variety. His books include "The Man Who Invented Rock Hudson," "Party Animals," and "Sexplosion: From Andy Warhol to A Clockwork Orange, How a Generation of Pop Rebels Broke All the Taboos." His latest book, "Money, Murder, and Dominick Dunne," was published in spring 2017.