Shares of Micron Technology (NASDAQ:MU) recently rallied after the memory-chip maker posted first-quarter numbers that crushed analyst expectations. Its revenue rose 71% annually, to $6.8 billion, beating estimates by $410 million and marking its fifth straight quarter of double-digit sales growth.

On the bottom line, its non-GAAP net income grew nearly ninefold annually, to $2.99 billion, or $2.45 per share -- which topped expectations by $0.25. Analysts expect Micron's revenue and earnings to respectively rise 37% and 97% this year.

Those impressive figures, along with Micron's low forward price-to-earnings (P/E) ratio of 5, make the stock look like an undervalued growth play -- even after its 94% rally this year. However, there are some indications that Micron's best days have passed, and that its stock could face a steep decline over the next two years.

Slowing revenue growth

Micron's revenue growth looks incredible, but its growth rate has been slowing down over the past few quarters.

Q1 2017 Q2 2017 Q3 2017 Q4 2017 Q1 2018 Revenue $3.97 billion $4.65 billion $5.57 billion $6.14 billion $6.8 billion Year-over-year growth 18.5% 58.7% 92.1% 90.7% 71.3%

Micron expects its revenue to rise 46%-55% annually during the second quarter. This beats the Street's expectation for 34% growth, but it still marks a gradual slowdown from its peak growth in the second half of 2017.

Micron is still expected to post double-digit sales and earnings growth in 2018, but analysts expect its sales and earnings to respectively fall 1% and 12% in fiscal 2019.

It's nearing a cyclical peak

That slowdown indicates that Micron's growth is closer to a cyclical peak than a trough. Micron previously struggled in the second half of 2015 and 2016 as memory prices fell on a worldwide oversupply of DRAM and NAND chips. Micron is currently the world's third-largest maker of DRAM chips and its fourth-largest maker of NAND chips.

Rising memory-chip prices throughout 2017 lifted Micron's top-line growth, but it's unclear when those prices will peak again. Micron expects the DRAM and NAND industries to respectively post 20% and 50% supply-bit growth in calendar 2018. The DRAM figure is near a multiyear low, but the NAND figure indicates that supplies could outpace market demand.

In late November, Morgan Stanley analyst Shawn Kim warned investors that DRAM and NAND prices would likely top out in mid-2018, and that it was a good time to take profits. Kim argues that while P/E ratios for companies like Micron look cheap, price-to-sales (P/S) ratios are a better gauge of market demand for the chips -- and Micron's current ratio of 2.2 doesn't look cheap on a historical basis:

Other headwinds on the horizon

There are also other challenges Micron must address over the next few quarters. First, the company remains well behind market leader Samsung (NASDAQOTH: SSNLF), the biggest DRAM and NAND maker in the world, in terms of scale and technology. Samsung recently claimed that it had developed the world's smallest DRAM chip, a "second generation" 10nm, 8-gigabit DRAM chip that offered improved energy efficiency and data-processing performance for cloud computing, mobile devices, and high-end graphics cards.

It also stated that it would shift most of its production to 10nm chips in 2018, putting it roughly one to two years ahead of smaller rivals like Micron and SK Hynix. Micron continues to develop new 3D NAND and 3D Xpoint technologies with its longtime partner Intel, but it's unclear if those advances can help it keep pace with Samsung.

As the competition heats up, all three chipmakers will be tempted to boost their production capacities to meet market demand before prices plummet. If that happens too quickly, supplies could rise and exacerbate the cyclical downturn.

There's also the potential threat of Chinese chipmakers abruptly flooding the market with cheap memory chips. Two cases of Micron's trade secrets being leaked to Chinese chipmakers over the past year indicate that investors shouldn't dismiss this potential threat.

Investors shouldn't panic

Micron might seem like it's running on borrowed time, but investors shouldn't panic. Demand should remain robust for several more quarters, and the continued diversification of Micron's business across the mobile, server, and solid-state-drive markets, as well as new memory technologies, could offset a cyclical downturn.

Nonetheless, investors should think carefully before buying Micron at these prices. Once memory prices start their inevitable decline, this stock could stay out of favor for at least one or two years.