U.S. chipmaker Micron Technology on Wednesday said it sees a recovery in the memory chip market coming and reported a quarterly profit that beat estimates as cost controls helped offset falling demand and prices, sending its shares up nearly 5 percent.

Micron makes NAND storage chips that are used in phones and internet servers as well as DRAM chips that help computer processors communicate with those storage chips.

The company beat revenue expectations for the fiscal second quarter ended Feb. 28. Although it gave a forecast for its fiscal third quarter that was below Wall Street's expectations, Micron said demand is likely to begin growing again by its fourth quarter.

The results come against the backdrop of a glut in the global semiconductor industry triggered by waning demand for smartphones and spotty purchasing patterns by cloud-computing vendors, which hurt chipmakers such as Intel Corp earlier this year.

Meantime, Micron trimmed its spending plans and said it had idled some factory lines to bring its chip output in line with lower demand, helping keep profits flowing and a share buyback plan on track.