Memory

The AI memory squeeze: DRAM prices, cloud costs and what it changes for JVM teams

Memory · Published 2026-10-24

A desktop motherboard with one memory module installed and two empty DIMM slots beside it
One module fitted, two slots empty: memory is the line item that has moved most since late 2025. Photo: dumanag, WordPress Photo Directory, CC0.

Since late 2025, memory makers have sent a growing share of their output to AI datacentres, and DRAM prices have climbed at a pace the industry had not seen before. Cloud list prices for ordinary instances have not followed so far, but the cost of memory now drives hardware budgets. This guide gathers the sourced figures, each with its date, and then turns to what JVM teams control: how many gigabytes a service actually needs.

Where the memory goes

AI accelerators use high-bandwidth memory (HBM), stacked DRAM packaged next to the GPU, and the servers around them use large registered DIMMs (RDIMM). Both are made on the same wafers as the DRAM that ends up in laptops and general-purpose servers. In a press release of 25 August 2026, TrendForce estimated that HBM and RDIMM combined will account for 51% of DRAM bit supply in 2026. The same release projects that DRAM and NAND flash combined will account for 47% of the major cloud providers' total capital expenditure in 2026 and 68% in 2027.

The makers' own results tell the same story. SK hynix, reporting on 29 July 2026, posted second-quarter revenue of 79.3187 trillion won, up 257% year on year, with an operating margin of 76%. It began mass shipments of HBM4 in the quarter and said that customer demand exceeds its supply capabilities. Samsung's second-quarter 2026 release (30 July 2026) reports KRW 127.5 trillion of revenue and KRW 89.2 trillion of operating profit for its DS (semiconductor) division and expects the memory market to stay undersupplied. Micron's fiscal fourth quarter, which ended on 3 September 2026 and was reported on 30 September 2026, brought revenue of $54.23 billion against $11.32 billion a year earlier, with a GAAP gross margin of 86.8%.

Contract and spot prices

Most DRAM is sold on quarterly contracts; the spot market is smaller and moves first. The TrendForce figures below are as published, forecasts as forecasts:

PeriodTrendForce figurePublished
2H25Server DRAM contract prices up a cumulative 64%; a further jump of about 270% expected over 202625 Aug 2026
1Q26Conventional DRAM contract prices up about 93% to 98% quarter on quarter; DRAM industry revenue up 81% to $97 billion1 Jun 2026
2Q26 (forecast)Conventional DRAM contract prices up 58% to 63%31 Mar 2026
3Q26 (forecast)Server DRAM contract prices up 13% to 18%, held back by long-term agreements with US cloud providers9 Jul 2026
4Q26 (forecast)Conventional DRAM contract prices up 10% to 15%30 Sep 2026
2027 (forecast)HBM contract prices could still rise by 70% to 140%25 Aug 2026

On the spot market, TrendForce's weekly update put the average price of the mainstream chip it tracks, DDR4 1Gx8 3200MT/s, at US$7.931 in its update of 22 October 2025 and at US$46.357 in the week of 20 October 2026. The later update adds that DDR5 supply remains tight and that suppliers are reluctant to sell. The direction is clear: prices are still rising, but each quarter's increase is smaller than the one before.

What a gigabyte costs in the cloud

The three large providers price general-purpose and memory-optimised instances side by side, so at a fixed vCPU count the price steps show what extra memory costs. On-demand Linux prices from the public price pages, read on 24 October 2026:

Provider, regionSize (4 vCPU)MemoryPer hour
AWS, N. Virginiac8i.xlarge8 GiB$0.18742
AWSm8i.xlarge16 GiB$0.21168
AWSr8i.xlarge32 GiB$0.27784
Google Cloud, Iowan4-highcpu-48 GiB$0.15308
Google Cloudn4-standard-416 GiB$0.1814
Google Cloudn4-highmem-432 GiB$0.23804
Azure, East USD4s v616 GiB$0.202
AzureE4s v632 GiB$0.265

Azure's Retail Prices API gives 1 October 2024 as the effective start date of both Azure rates, so for those two sizes the list price predates the rise in memory prices. Committed-use and reserved prices are lower than these figures. For a JVM team, the useful point is simpler: going from 16 to 32 GiB on the same vCPUs is a separate, visible step on every price list. A service that fits in the smaller size, with headroom, never pays it.

Spend fewer gigabytes per service

Most JVM services are given far more memory than their live data needs, because the safe answer to an OOM kill is a bigger limit. The tools to size them properly are already in the JDK.

Measure before cutting

Run the service under realistic load with -XX:NativeMemoryTracking=summary and read the committed values per category at peak, as described in Native Memory Tracking. Take the heap's live set from the GC log (the occupancy after a full or mixed collection; see reading GC logs). These two numbers, plus a margin, are the budget. Anything above them is memory you pay for and do not use.

Size the heap from the live set, not the limit

The default heap is 25% of the container's memory, and many teams answer that by raising MaxRAMPercentage and then raising the limit as well. Do it the other way round: decide the heap from the live set and the allocation rate, add the non-heap budget, and set the container limit to the total. The JVM in containers has the full budget table. If -Xms equals -Xmx, the whole heap is committed from the start; leave them different when you want an idle service to use less.

Cap off-heap memory explicitly

Direct buffers default to a limit roughly equal to the maximum heap, which means a container sized for the heap alone can be killed during a burst of I/O. Set -XX:MaxDirectMemorySize, -XX:MaxMetaspaceSize and, where relevant, -XX:ReservedCodeCacheSize from measured values. Explicit caps turn a silent container kill into a diagnosable OutOfMemoryError; see direct buffer memory.

Shrink every object: compact object headers

JEP 450 (JDK 24) reduced the object header in HotSpot from between 96 and 128 bits to 64 bits on 64-bit platforms, as an experimental option. JEP 519 made it a product feature in JDK 25, so -XX:+UnlockExperimentalVMOptions is no longer needed:

# JDK 25 and later
-XX:+UseCompactObjectHeaders

JEP 519 cites results from experiments: in one SPECjbb2015 setting, 22% less heap space and 8% less CPU time; in another, 15% fewer garbage collections with both G1 and Parallel. It is not the default layout. Services with many small objects (maps, DTOs, boxed values) gain most; measure your own live set before and after, on a canary.

Share class metadata: CDS

Class Data Sharing maps a pre-built archive of class metadata into the process. The JDK documentation explains that part of the archive is mapped read-only and shared among JVM processes on the same host, which reduces memory footprint when several JVMs run side by side, and that a default archive ships with the JDK since JDK 12. On a node running many replicas of the same image, an application archive (or the AOT cache from JEP 483, JDK 24, which also speeds up startup) is cheap to adopt.

Choose a collector that gives memory back

A heap that grew during a peak stays committed unless the collector returns it. JEP 346 (JDK 12) lets G1 return unused committed memory when idle through periodic collections set with -XX:G1PeriodicGCInterval (in milliseconds); the feature is disabled by default, and the JEP's motivation is precisely containers where resources are paid by use. JEP 351 (JDK 13) made ZGC uncommit unused memory, enabled by default. For small, single-CPU containers the JVM already picks Serial, which has the smallest footprint; choosing a collector covers the trade-offs.

Checklist

Sources