Memory chipmaker Micron Technology (MU -0.94%) has rallied more than 40% this year -- which might seem odd for a company which has posted six straight quarters of annual revenue declines. Most of that rally was fueled by the belief that global demand for memory chips will rise and cause prices to keep rising.

Image source: Micron.

However, those bullish expectations might have caused Micron's stock to get ahead of itself. Let's take a look at three major headwinds which could blow the stock off course next year.

1. The supply crunch eases

Micron's sales have been falling due to an oversupply of DRAM and NAND chips. However, bullish interest in the stock was sparked by several reports that DRAM and NAND supplies were tightening up again.

Back in August, HP (HPQ -2.00%) CEO Dion Weisler claimed that the company's PC business was facing shortages of memory chips. In October, TrendForce forecast that DRAM prices would hit a two-year high this year due to a supply crunch. The research firm also estimated that the global supply of PC DRAM chips was declining, as memory chipmakers expanded into the adjacent markets of mobile devices and data centers.

In the NAND market, DRAMeXchange recently estimated that prices of SSD and eMMC devices will rise over 10% sequentially in the first quarter of 2017, due to a shortage of NAND chips attributed to strong smartphone shipments in China, stable SSD growth, and the increase in the average NAND flash density in eMMC (embedded multimedia controller) and eMCP (embedded multi-chip package) devices.

However, Micron is still vulnerable to sluggish PC sales (which have declined annually for eight straight quarters), peaking smartphone sales, and competition from bigger rivals in the DRAM and NAND markets. These factors could all cause supplies to rise and prices to fall again -- which means that analysts' expectations for 31% sales growth next year could be too optimistic.

2. The competition heats up

Micron is the fourth largest NAND maker in the world after Samsung (NASDAQOTH: SSNLF), Toshiba, and Western Digital's (WDC -2.25%) SanDisk. It's also the third largest mobile DRAM maker after Samsung and SK Hynix.

Competing against Samsung is tough, since the South Korean tech giant can use its massive foundry to reduce production prices and other non-semiconductor business segments to offset lower memory chip prices. If we look at Micron's gross and operating margins over the past five years, we can see how price declines and competition hurt its bottom line growth.

MU Gross Profit Margin (TTM) Chart

Source: YCharts

This chart suggests that Micron's margins could fall even further before bottoming out. Furthermore, Micron's efforts to expand its moat -- including its development of faster 3D NAND and 3DXpoint tech with Intel (INTC 1.74%) and its acquisitions of smaller memory chip makers like Inotera Memories -- will cause expenses to rise and weigh down earnings growth. Therefore, Wall Street's forecast for Micron's non-GAAP earnings to surge from $0.06 per share last year to $1.63 per share this year could also be too bullish.

3. The looming Chinese threat

Meanwhile, China wants to build its own domestic semiconductor market for two reasons -- concerns about the security of U.S. tech, and the need to boost its own economic growth.

That's why China's state-backed conglomerate Tsinghua Group tried to buy Micron and a 15% stake in Western Digital earlier this year. However, both deals were eventually terminated due to U.S. security concerns. Nonetheless, the Chinese government and Tsinghua are still aggressively developing their own semiconductors across multiple industries -- which means that it could eventually flood the market with cheap memory chips and bury smaller players like Micron.

During a recent event in Taipei promoting the merger of Micron and Inotera, Micron CEO Mark Durcan warned that if China spends "the money that they say they are capable of spending, they can create oversupply." He noted that the move was "absolutely" a concern for the entire industry.

But will Micron fall next year?

These three challenges could be tough for Micron to address, but I also don't think the stock will fall off a cliff next year. DRAM and NAND prices should continue rising unless sales of PC and mobile devices plummet. Its new 3D NAND and 3DXpoint tech should help it keep pace with its bigger rivals, and the distant Chinese threat shouldn't hurt its results over the next few quarters. Nonetheless, Micron remains a fairly risky play and should only be bought by investors who fully understand the cyclical nature of the DRAM and NAND markets.