Only a few years ago, a cry went up that the United States needed more oil refineries. The perceived shortage was so acute that George W. Bush, president at the time, even offered disused military bases as sites for building them.

Not only did that never come to pass, but the reverse is now happening. The business of oil refining is mired in a deep crisis, with five refineries having shut down this year, including plants in Delaware, New Jersey, California and New Mexico.

Gasoline demand, which many analysts had long expected to keep rising for decades, is down sharply in the recession. And refiners are increasingly convinced that even after the economy recovers, demand will not grow much in coming years because of the rise of alternative fuel supplies and the advent of tougher efficiency standards for automobiles.

The recent closings signal the end of a period from roughly 2004 to 2008, when demand soared, refineries operated near capacity and profits swelled. For drivers, that meant gasoline prices at $3 or $4 a gallon, especially when hurricanes knocked out refining capacity on the Gulf Coast. For refiners, this gilded period turned out to have been an anomaly.