Shares of Micron Technology Inc. gained about 6% in premarket trading Thursday after the largest U.S. maker of memory semiconductors gave a strong revenue forecast, indicating that data center demand is compensating for a slowly recovering market for personal computers and smartphones.