Only last year, many people in the shipping industry felt that they were experiencing the best conditions in their careers -- and possibly ever.

Bulk carriers were prospering, thanks to China's vast appetite for the commodities needed to feed its factories, and the container lines hauling finished products to Western markets were thriving too.

Fortunes were made.

The share prices of two shipping companies listed in Hong Kong -- Pacific Basin and Jinhui Holdings -- increased fivefold between the middle of 2006 and the middle of 2007.

Meanwhile, staggering sums were made in private transactions. Ships generally decline in value as they age, yet an iron-ore carrier built for $31 million in 2001 was sold for $150 million in 2007 and was immediately leased out on a long-term contract, making a vast profit for the buyer, even after that made by the seller.

The cycle has not entirely turned. An oil tanker bought for $142 million and still under construction was recently resold for $168 million, because the petroleum business remains strong. Gains in shipping lines' and shipbuilders' reported sales and profits are still impressive, and the world economy continues to expand. But signs of weakness are starting to show.

On March 3, Pacific Basin announced annual profits of $472 million, up 328 percent on the previous year. But its share price is down almost 30 percent from its peak last November.

Jinhui's shares are down even more, and in late January it said it had paid $4 million to cancel construction contracts for two huge ore carriers, worth $123 million each, that it had ordered in November -- at the very moment that may, in retrospect, have been the shipping industry's inflection point. The cancellation was attributed to financial difficulties flowing from America's credit crunch. But bankers seem suddenly alive to the possibility that demand for shipping may be slowing just as the supply of ships is increasing.

Other firms also are showing signs of concern and are taking tentative steps toward consolidation. Denmark's Maersk Line, the industry leader, plans to begin sharing vessels with competitors on some transpacific routes, as part of a broad cost-cutting program. Singapore's Neptune Orient Lines has been discussing a tie-up with TUI of Germany, although their talks recently were said to have broken down.

Of course, the industry has weathered plenty of ups and downs in the past, most recently in the late 1990s. It remains profitable overall. But as its revenues grow, its margins are falling, according to UBS, an investment bank.

The main problem is that growing demand in 2003 prompted shipping lines to order too many new ships. About 60 percent of the global capacity is about to be floated, adding to a huge increase in supply over the past three years.

The glut of shipping capacity has forced down rates. But the shortage of crews and the rising oil price mean the cost of running ships is rising. And because inflation is pushing up the value of cargos, insurance costs are going up as well. Minor savings are possible, notably by reducing the speed of ships to save fuel, but customers are increasingly intolerant of delays.

The new supply and higher costs hit just as shipments from Asia to America's West Coast -- the busiest route -- showed a five-month decline, the most protracted since 1995, according to data collected by UBS. Shipments from Europe to America also are shrinking, after three years of solid growth.

There are some bright spots: Shipments from Asia to Europe, no doubt helped by the rise of the euro, are expected to increase by 12.5 percent this year, UBS said -- though that estimate is lower than previous forecasts. The sharpest increase in shipments is from America to Europe and Asia, but that will not be enough to offset the decline in traffic from China.

Despite the heavy weather ahead, it may be some consolation to remember that although the shipping industry is among the first to feel the chill of a slowdown, it will also be the first to benefit from a recovery, whenever that comes. And it will have plenty of capacity.