Since the 1950s, department chains like Sears and J.C. Penney have anchored suburban shopping malls. But hundreds of stores are expected to soon close their doors. Sears, an iconic mall mainstay, plans to shutter more than 300 locations in the US by the end of this year, and J.C. Penney recently said it would close 138 stores because of waning traffic and sales.

But now a different type of company is moving into their vacated spaces: grocery stores.

"Food retail is one thing helping struggling malls survive," June Williamson, an architecture professor at the City College of New York who cowrote "Retrofitting Suburbia," told Business Insider.

Kroger, the largest US grocer, with nearly 4,000 locations, recently purchased a former Macy's at Kingsdale Shopping Center in Upper Arlington, Ohio, for $10.5 million, not long after the department store announced it would close the 45-year-old location. 365 by Whole Foods (a smaller, more economical version of the well-known chain) will open at College Mall in Bloomington, Indiana, in late 2017, according to Indiana Public Media.

And Wegmans Food Markets is moving into a former J.C. Penney at the Natick Mall in Massachusetts. The shop is set to open in 2018. The grocer decided to move into the mall because the vacant department store has a lot of space and ample parking, Wegmans spokeswoman Valerie Fox told Business Insider. The mall's location, near numerous housing developments, is also convenient for shoppers.

Wegmans already operates a location in Montgomery Mall in Pennsylvania, and another at Hunt Valley mall in Baltimore County, Maryland (which was redeveloped into an outdoor shopping center in 2000). "Because our business model is predicated on high volume, we need a lot of customers to shop in our stores," Fox said of the decision to move into Natick Mall. "While we don't specifically seek out shopping malls, we consider them if they meet the things we're looking for ... Natick Mall met all our criteria for a store site."

A Kroger store in Charlottesville. Hollis Johnson

Natick Mall started expanding in late 2006, adding nearly 100 stores as well as a connected condo complex over the next the two years. But the 2008 financial crisis affected the mall's sales, The Boston Globe reported at the time. The center, renamed Natick Collection, was envisioned as a luxury destination for suburban shoppers, but upscale stores like Neiman Marcus and Gucci had trouble catching on. The mall's J.C. Penney closed in August 2015 because of declining sales.

Losing an anchor store can make it difficult for a mall to survive, since department stores often pay a large part of the lease, Williamson said. But mall department stores have an opportunity to fulfill other community needs besides traditional clothing retail. Suburban malls are convenient for grocery shoppers because they often are already close to housing or accessible by public transportation. In the digital age, supermarkets or other food-related businesses, like indoor farms and farmers markets, could prove to be more financially viable for shopping centers than traditional anchors.

"Part of it is a survival tactic," Calvin Schnure, an economist with the National Association of Real Estate Investment Trusts, told The Washington Post. "E-commerce is changing people's spending patterns. But in the process, they are changing the shopping experience in a mall."

Beyond indoor supermarkets, Williamson predicts, some shopping malls could also be good homes for other types of food preparation and retail. This can be seen in the recent growth of suburban farmers markets, often held weekly in mall parking lots from Everett Mall in Washington to Greece Ridge Mall in Rochester, New York.

Retrofitting malls for food production, in addition to retail, would create more jobs that are resistant to outsourcing, she added.

"Construction is one of those not-so-easy-to-outsource fields," Williamson said. "That's partly why new house starts, which bring labor and have to happen on the ground, are so important to our economy. Another area is food. By moving into malls, agricultural operations could be more integrated into already built communities. And a lot of these suburban areas were agricultural landscapes not that long ago, before they were developed. There could be a premium for things grown locally."

An urban farm at K11 Mall in Shanghai. Helen Morgan

There are no American malls, to Williamson's knowledge, that grow fresh food themselves. (Food courts usually heat up frozen items that are shipped to them.) But some malls abroad are experimenting with food production. The Shanghai K11 mall, for example, has an indoor farm that grows vegetables, raises pigs, and sells its own produce. In late 2016, a rooftop farm was also built on top of Israel's oldest shopping mall, in Tel Aviv.

"There are too many malls" in the US, Williamson said. "Conventional department stores are under threat, partly from online shopping and people wanting to go to the specialty boutique rather than the Macy's. People still want to go out, and food is a real draw for the social part of consumption. So you may buy your socks online, but you might want to go out with your friends to eat or grocery shop at the mall."