Writing

The Memory Subsidy

Software has been written on the assumption that memory gets cheaper. AI datacenters have reversed the curve, and the bill is arriving in every layer of the stack.

For most of the history of commodity computing, memory got cheaper. Not every quarter, and not without painful reversals, but reliably enough that a generation of software was written as if memory were free. The assumption was rarely stated. It did not need to be. It was baked into runtimes, deployment defaults, and the ordinary advice to spend engineering time on features rather than on footprint.

That assumption is now being repriced. The repricing is not a quarterly spike, and it is not confined to the component market. It is showing up in phone prices, in routers, in cloud bills, and in the machines developers use to run a build.

The forecast is not subtle

On December 2, IDC published its 2027 device forecast, and the headline numbers are the kind that usually accompany a recession rather than a supply chain. Smartphone shipments are expected to fall 14.0 percent in 2026, to 1.09 billion units, and another 12.6 percent in 2027, to 953 million. That would be the first year below one billion since 2012. PCs follow a similar path: down 13.9 percent this year to 255 million, then down 11.2 percent to 227 million.

IDC is explicit about the cause. AI datacenter demand has absorbed a growing share of DRAM and NAND output. Multiyear supply agreements and locked-in AI orders now take about half of available capacity. Memory revenue is expected to grow four to five times in 2026, while DRAM and NAND average selling prices rose 47 and 63 percent respectively in the second quarter. Relief is not expected before the second half of 2028.

The detail that matters most is not the shipment decline. It is the shape of the market that remains. The sub-$200 smartphone segment was 533 million units in 2025. IDC’s previous forecast had it at 285 million in 2027; the new one has it at 180 million. The low end has not been squeezed. It has been removed. What is left is a smaller, more expensive market, with the worldwide average selling price rising 28.7 percent to $586 in 2026 and another 16.5 percent to $682 in 2027.

This is not only a consumer story. TrendForce puts the top five NAND makers at roughly $86.3 billion in revenue in the third quarter of 2026, and the industry as a whole above $100 billion for the first time. Kioxia grew 40 percent in a quarter. YMTC shipped nearly 50 percent more than a year earlier. The suppliers are not struggling. Their customers are.

What the subsidy paid for

It is worth being precise about what cheap memory bought, because the list is longer than it looks.

It bought the Electron app that ships a browser with every chat window. It bought the JVM service with a two-gigabyte heap because tuning it was a week of work nobody wanted. It bought the container image with three language runtimes and a build toolchain, because a smaller image meant a multi-stage build and a conversation about base images. It bought the microservice that holds an entire tenant’s data in memory because the database was slow. It bought the cache that never expires, the log buffer that grows without a bound, the queue with no backpressure, and the test suite that runs eight parallel workers on a laptop.

It also bought a style of capacity planning. When memory is cheap, the answer to a memory problem is more memory. Add a node. Raise the limit. Move to a larger instance. The decision is reversible, the cost is small, and the alternative is engineering time that could go into the product. That is not laziness. It is a rational response to prices.

The same logic shaped the cloud. Serverless pricing is denominated in memory-seconds. Container platforms bin-pack by requested memory. Managed databases tier by RAM. A service’s architecture determines its bill long before anyone looks at a cost dashboard, and for a decade the memory term in that bill was the part you could safely ignore. Now it is the part that is moving.

The consumer side is blunter. Golem reports that AVM raised the recommended prices on seven Fritzbox models and several other devices, citing expensive RAM. A router is not an AI product. It is a small computer with a fixed function, and its bill of materials just went up because the memory inside it is now competing with a datacenter.

The residual customer

The structural reason this upcycle is different is priority. In previous memory cycles, a shortage eventually called forth capacity, and consumer devices competed for it on price. This time the marginal buyer is an AI datacenter with a multiyear contract and a much higher willingness to pay.

IDC addresses the obvious objection directly: would an AI correction release memory back to client devices? Its answer is no, at least not quickly. Long-term agreements run through 2030 and 2031. New capacity arriving in 2028 is expected to be prioritized for AI and servers, because that is where the margin is. Client devices go to the back of the queue. The shortage can outlast the enthusiasm that caused it.

That is the part software people should internalize. The price of memory is no longer a background constant that trends down. It is a strategic input allocated by contracts, and the consumer of that input is a residual claimant. The same is true inside a company: the team whose workload is memory-bound is now competing for budget with every other team, and the budget is growing.

There is a second-order effect that is easy to miss. The AI buildout is making the hardware for AI more expensive. Local inference, the subject of so much optimistic writing this year, depends on memory capacity and memory bandwidth. A machine that can hold a useful model is a machine with a lot of RAM, and RAM is the component whose price is rising fastest. The models get smaller and better; the boxes that run them get more expensive. Both trends are real, and they pull in opposite directions.

Efficiency becomes a budget line

The engineering response is not a return to hand-optimized assembly. It is something more ordinary and more durable: treat memory as a budget with an owner.

That means measuring before choosing. Most services know their CPU utilization and their latency percentiles. Far fewer know their resident set size under real traffic, their peak heap, their per-connection overhead, or the memory cost of their dependency tree. The numbers are usually available and rarely looked at. A memory profile taken once a quarter is enough to find the outliers, and the outliers are usually a small number of decisions: an unbounded cache, a buffer sized for the worst case, a library that loads a dataset at startup, a request path that materializes a response it could stream.

It means setting limits that are real. A container memory limit that is twice the observed peak is not a safety margin; it is a reservation that the scheduler must honor and the bill must pay. A heap that is allowed to grow to the size of the host is a decision to let the garbage collector decide when the process dies. The discipline is the same one good teams already apply to latency: define the budget, instrument against it, and treat a regression as a regression.

It means preferring bounded structures. Queues with a maximum depth and a defined rejection policy. Caches with an eviction rule and a measured hit rate. Streams instead of whole-file reads. Pagination instead of a list that grows with the customer. None of these are novel. They are the ordinary vocabulary of systems that were written when memory was scarce, and they became optional when it was not.

And it means being honest about the trade. Memory efficiency is not free. It costs engineering time, it can add complexity, and it can make code harder to read. The right question is not “is this efficient?” but “is this the place where efficiency is worth paying for?” A batch job that runs once a night can be wasteful. A service that holds a session for every connected user cannot. The answer depends on the shape of the cost, which is exactly the kind of judgment that a falling price curve used to make for us.

The horizon problem

The hardest part is timing. Software decisions are made in weeks. Memory capacity is planned in years. If relief does not arrive until the second half of 2028, then a service designed this quarter will spend its first two years in a regime of rising memory costs. The architecture that is cheap to build today may be expensive to operate for its entire first generation.

That does not argue for premature optimization. It argues for avoiding decisions that are expensive to reverse. A monolith that holds too much state can be split later, but a data model that assumes every tenant fits in memory is harder to undo. A runtime with a large baseline footprint can be replaced, but a product that depends on its startup behavior cannot. The durable move is to keep the memory-intensive parts of the system behind interfaces you control, so that the fix is a deployment rather than a rewrite.

There is a useful asymmetry here. The cost of measuring is low. The cost of a memory-driven outage is high, and the cost of a memory-driven margin problem is slow and quiet. Teams that instrument now will have the option to act when prices or traffic change. Teams that do not will discover the problem in a bill, a page, or a failed deploy, and by then the cheapest fixes will already be gone.

The loan comes due

For thirty years, cheap memory was a subsidy paid by hardware progress to software practice. It funded a great deal of useful work, and it made possible a style of engineering that optimized for the scarcest resource, which was people. That trade was correct. It is being repriced, not repealed.

The repricing does not mean the end of ambitious software. It means the bill for a decade of assumptions is arriving at the same time as the demand that caused it. The AI buildout is consuming the substrate it runs on, and the residual claimants are the phone in your pocket, the router in your hallway, the laptop on your desk, and the container that serves your product.

Cheap memory was a loan. The interest is due, and the statement is itemized.