About Compilation Streaming
Compilation Streaming (CoCa Streaming) delivers pre-compiled machine code to the JVM at startup. Compilations covered by the stream are installed directly, without local JIT compilation or a Cloud Native Compiler (CNC) round-trip. Compilations not covered by the stream fall back to CNC as usual.
Compilation Streaming is available starting with Optimizer Hub 26.08.0 and requires Azul Zing 26.08.1.0 or later.
Objectives
The primary goal is to reduce Optimizer Hub resource consumption and scaling spikes under load. The secondary goal is to improve warm-up.
How Streaming Changes Warm-up
Without streaming, the JVM requests each compilation from Optimizer Hub individually during warm-up. Even with a high Code Cache (CoCa) hit rate, every compilation must be requested, validated, and installed one by one. This lengthens warm-up and creates load spikes on Optimizer Hub.
With streaming, Optimizer Hub builds a stream of ready-made compilations for the application in advance. The JVM downloads it segment by segment and does not need the whole stream at once.
Components
-
Cloud Native Compiler (CNC) compiles code on the server.
-
Code Cache (CoCa) stores the compilations that are produced by CNC.
-
ReadyNow Orchestrator (RNO) collects ReadyNow profile data from JVMs, develops the profile over generations, and promotes it. The profile contains profile data and identifiers of compilations, not the code itself.
-
The Stream Builder takes the promoted profile from RNO, finds the matching compilations in CoCa, and assembles them into a stream.
flowchart LR
JVM["Azul Zing JVM"]
subgraph OH["Optimizer Hub"]
CNC["Cloud Native Compiler"]
CoCa[("Code Cache")]
RNO["ReadyNow Orchestrator"]
SB["Stream Builder"]
end
CNC -->|stores compilations| CoCa
JVM -->|sends profile data| RNO
RNO -->|promoted profile| SB
CoCa -->|matching compilations| SB
SB -->|stream, segment by segment| JVM
Stream Build Triggers
All existing streams of a profile name are rebuilt when ReadyNow Orchestrator promotes a new profile generation. They are not rebuilt between promotions. A new stream is also built on demand when a JVM with a new VM Description requests one and none exists.
What to Expect on the First Runs
The stream contains only ReadyNow-triggered compilations, and only those are looked up in it. Compilations that were not triggered by ReadyNow are never served from the stream and fall back to CNC as usual.
The generation-0 stream is built from compilations that were not triggered by ReadyNow, so it brings almost no benefit.
After JVMs run with the generation-0 profile, Code Cache accumulates ReadyNow-triggered compilations, and the stream rebuilt after the next promotion contains them. The earliest run that can benefit is therefore the third one. The exact timing depends on promotion thresholds and stream build time.
See Understanding ReadyNow Orchestrator Generations for more information.
Compatibility
Streams are served only to JVMs with a compatible VM Description (Zing version, CPU and its features, JVM flags, compile commands), because these factors influence the generated code. If no compatible stream exists, the JVM runs normally and a build is scheduled.
Streaming cannot be combined with Indirect Delivery of the ReadyNow profile.
Memory
Streaming uses additional native (non-heap) memory on the JVM during warm-up for the active stream segments and buffers, with a short peak while segments are downloaded and parsed. By default, streaming stops and releases this memory 600 seconds after JVM start.
The overhead depends mainly on the number of active segments and the application size. It is visible in Native Memory Tracking, not in the GC log.