In the script for his memory play “The Glass Menagerie,” Tennessee Williams wrote, “Memory takes a lot of poetic license. It omits some details; others are exaggerated, according to the emotional value of the articles it touches, for memory is seated predominantly in the heart.” Williams wasn’t wrong, but Alan Bennett’s memory play “The Lady in the Van” — now a feature film starring Maggie Smith — shares its poetic real estate in equal measure between the heart and the head, rescuing the story from pure sentimentality.

A British institution, Alan Bennett has authored 22 plays, 20 teleplays, six screenplays, and upwards of 20 books, including a couple of memoirs. In 1989, at age 55, he wrote “The Lady in the Van” for print, followed swiftly by a radio-play version. Nine years later, it took the stage; 10 years later, the radio; and now, the big screen in a version adapted by the author for director Nicholas Hytner, who previously directed films of Bennett’s, “The History Boys” and “The Madness of King George.” That is to say, the material has been road-tested.

A fanciful memoir introduced as “a mostly true” story, “The Lady in the Van” is as much about Bennett as the title character, the homeless woman “Mary Shepherd.” Alex Jennings winningly reprises his stage and radio role of Bennett, depicted as a dedicated author and weak-willed person, both given to theatrical flourishes.

“The writer is double. There is the one who does the writing. And there is the one who does the living,” the screen Bennett muses.

And there is the woman who squats in his Camden Town, London, driveway; the short, smelly figure, made square by her overcoat, head scarf and hat — nearly as square as her boxy, yellow van. With Bennett’s hesitant consent (“just till you sort yourself out”), Shepherd holds her ground between 1970 and 1984.

As go the years, so go the layers built up over her past. Bennett gradually learns who she was in her youth and the secret that has driven her into a life of paranoid victimhood. And with those years comes unexpected caring to rival that for his own sickly mother.

Though at times precious, Bennett’s sly script masks that deeply sentimental core with comic edge and a writer’s willful, mercenary remove. The pleasure isn’t in the meandering story but in Bennett’s endlessly inventive prose and the percolating performances, especially the latest astringently lovable turn by international treasure Smith.

Bennett deals frankly with the cruel, physical and social indignities of age and the ageless struggle of self-definition, as challenged by society. To the world, “Mary” is but a decrepit, homeless, smelly nuisance. Bennett, nearly as suspect, is a homosexual playwright to be heard and not seen. Still, these two tacitly agree to each other, in an unlikely but extant truce, a nurturing understanding between two artists.

Rated PG-13 for a brief unsettling image. One hour, 44 minutes.

Leave a comment