SSerguey Asael Shinder
Java coding notes: the JVM, and writing software that lasts

Serguey Asael Shinder: JEP 545 targets JDK 28: ZGC starts with a 2MB heap and grows it aggressively

· by Serguey Asael Shinder / Serguey Shinder

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.

Serguey Asael Shinder: JEP 545 targets JDK 28: ZGC starts with a 2MB heap and grows it aggressively
JEP 545 targets JDK 28: ZGC starts with a 2MB heap and grows it aggressively — Serguey Asael Shinder

What changes.

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.