Sun Microsystems, the maker of server computers, reported a fourth-quarter loss yesterday on costs related to job cuts and said demand for new products raised sales.

The net loss was $301 million, or 9 cents a share, in contrast to a profit of $50 million, or 1 cent a share, in the period a year earlier. Sun, based in Santa Clara, Calif., said sales rose 29 percent, to $3.83 billion.

The chief executive, Jonathan I. Schwartz, presiding over results for the first time since taking that position April 24, is cutting as many as 5,000 workers this year to help reverse five years of losses. Sun updated its storage devices and servers, computers used to run corporate networks, to help reclaim market share lost to rivals.

“The new product cycle is driving a return to growth,” said Brent Bracelin, an analyst at Pacific Crest Securities in Portland, Ore.