Image source: Micron Technology.

Oversupply in the memory chip market has plagued Micron Technology (MU -1.72%) in recent quarters. Revenue began to decline in the middle of 2015, and earnings turned negative earlier this year. Memory prices are now strengthening, leading Micron to return to both growth and profitability in its fiscal first quarter. The company beat analyst estimates across the board when it reported its results on Dec. 21, and its guidance predicts an even better second quarter.

A rapid recovery

Almost everything went right for Micron during the first quarter. Sales volume soared for both DRAM and NAND chips, up 18% and 26%, respectively, compared to the previous quarter. The average sales price for DRAM jumped 5%, while NAND prices were flat. During fiscal 2016, DRAM prices plunged 35% and NAND prices were down 20%, so even a small rise in prices represents a dramatic reversal compared to recent quarters.

As prices were rising, Micron managed to cut per-bit costs. DRAM costs dropped 5% and NAND costs dropped 8%, leading to a major improvement in gross margin compared to the fourth quarter. Gross margin was 25%, up 7 percentage points sequentially.

Strong pricing is expected to continue into the second quarter. Micron sees revenue between $4.35 billion and $4.7 billion, with a non-GAAP gross margin between 31% and 34%. Micron typically manages gross margins in the low 30s during the best of times, so Micron's guidance suggests a very quick recovery.

Non-GAAP operating income is expected to double compared to the first quarter, to a range of $800 million to $900 million. That implies a non-GAAP operating margin somewhere around 19%, a typical number in Micron's best years.

Both PCs and mobile devices drove growth for Micron during the first quarter. The compute and networking segment grew revenue by 18% sequentially, driven by strong demand for Micron's 20nm products. Graphics DRAM was an area of strength, with GPU launches and strong console sales driving sales higher. The segment produced a non-GAAP operating margin of 13.9%, up from just 0.8% during the fourth quarter.

The mobile segment wasn't as profitable, posting an 8.6% non-GAAP operating margin. But revenue soared 54% sequentially, driven primarily by customer qualifications. The segment posted a loss during the fourth quarter, and Micron pointed to the ramping of 20nm products and reduced high-cost early production inventory as the drivers behind the improved profitability.

Micron CEO Mark Durcan summed up the quarter in the company's conference call:

To summarize, we're entering our second quarter with a number of positive drivers across the business. The markets for both DRAM and NAND are healthy and improving, and I'm pleased with our operational execution over the past several quarters. We will continue deploying leading edge technology and shifting our product portfolio toward higher value segments and products.

The good times won't last forever

Fiscal 2017 should be a great year for Micron, based on the company's results and guidance so far. Supply is failing to keep up with demand, leading prices to rise and Micron's margins to fatten. But just like last time Micron was wildly profitable, during fiscal 2014 and 2015, this period of exceptional profitability won't last forever.

On the same day that Micron reported its results, fellow memory chip manufacturer SK Hynix announced that it planned to invest $2.7 billion to boost memory chip production, aiming to take advantage of surging demand and prices. Most of this investment will go toward building a new NAND chip plant, while the rest will go toward raising DRAM production at existing facilities.

It will take time for this additional capacity to come online, so Micron doesn't have anything to worry about in the near term. But the idea that these high levels of profitability are sustainable goes against history. If there's market share to be won by increasing capacity, then capacity will eventually be increased.

Micron had a great first quarter, and the next few quarters are shaping up to be even better. But investors should be careful not to get ahead of themselves.