Serguey Asael Shinder: JEP 545 targets JDK 28: ZGC starts with a 2MB heap and grows it aggressively
JEP 545, "Faster Startup and Warmup with ZGC", owned by Erik Österlund, moved to Targeted for JDK 28; the JEP page was last updated on 15 October 2026, and Inside Java listed it as targeted on 16 October. It is reviewed by Alex Buckley, Dan Heidinga and Mark Reinhold and endorsed by Vladimir Kozlov, and it relates to JEP 546, Adaptive Heap Sizing for ZGC.
The trade-off it wants to remove. The JEP explains that with ZGC, the initial heap size (-Xms) decides between fast startup and fast warmup. Committing physical memory from the operating system is not bookkeeping: the OS has to find free pages and zero them before mapping them. A small initial heap starts quickly but warms up slowly, because ZGC keeps committing more memory as the application allocates; a large one does the reverse. The JEP gives the extreme case: on typical current hardware, the JVM starts in about a tenth of a second with a 2MB initial heap but needs over ten seconds with a 32GB initial heap.

What changes.
- A 2MB initial heap by default. Traditionally ZGC committed 1/64 of physical memory at startup — 16MB on a 1GB machine, 2GB on a 128GB machine. The proposal is to commit just one 2MB region.
- Aggressive, concurrent expansion. When ZGC first sees a high frequency of collections, it expands the heap proactively and in successively larger steps, which the JEP says bounds the number of expansions logarithmically. Expansion runs on ZGC's own worker threads, never more than 25% of the available CPU threads.
- Pre-touch on expansion, not at startup. Instead of
-XX:+AlwaysPreTouchtouching the whole initial heap beforemainruns, worker threads write to newly committed pages as they expand the heap, so the page faults move off the application's path. - Large pages on Linux. From Linux 6.1, any process can ask the kernel to upgrade a range of small pages to large ones without superuser configuration. ZGC would do that during expansion, so the heap is eventually backed by 2MB pages.
What it means for flags. Together with adaptive heap sizing, the JEP says it becomes "neither necessary nor desirable" to set -Xms, -Xmx or -XX:+AlwaysPreTouch; the intended command line is java -XX:+UseZGC -XX:+ZAdaptiveHeapSizing .... In its case study on Spring PetClinic, the changes reduce startup time by almost 40% and warmup time by almost 90%. The JEP is explicit that the same techniques will not be used on every operating system — large pages by default on Linux, for example, but not on Windows.