How do I configure workers to fully allocate heap at startup?

Some JVMs automatically allocate the full heap at startup and touch all memory pages (e.g., Azul Zing 13). When migrating to JVMs that don't do this automatically (e.g., Zing 17 or standard OpenJDK), you may want to restore this behavior for specific workers.

Solution

Create a custom JVM profile that combines:

  • -Xms equal to -Xmx — Commits the full heap size at startup.
  • -XX:+AlwaysPreTouch — Touches all heap pages during startup, allocating them into physical memory and avoiding potential allocation failures during operation.

Add the following to iris-environment.prop in the controller/console/web API service stanza:

Then select EagerHeap as the JVM profile for workers that need this behavior.

Kubernetes installations

Kubernetes installations already include these settings by default for the G1 GC profile. If you're running on Kubernetes and using G1 GC, no additional configuration is needed.