Using Compile Stashing
Compile Stashing is a Azul Zulu Prime Builds of OpenJDK (Azul Zulu Prime JVM) feature that caches compiles performed in one run and reuses them in subsequent runs.
Compile Stashing used with ReadyNow has mixed results but has been shown to significantly reduce compiler start time and CPU usage in some cases.
Usage Recommendations
It is recommended to use Compile Stashing with ReadyNow for the best results.
Note
|
Starting with ZVM 19.12.0.0, Compile Stashing is not enabled by default with the ‑XX:ProfileLogOut command-line option. Compile Stashing is still enabled by default only in combination with the ‑XX:ProfileLogIn command-line option.
|
Use -XX:+FalconUseCompileStashing
if you need to turn on Compile Stashing, and -XX:-FalconUseCompileStashing
to turn it off. The structure of a disk cache location can change. It is safe to delete an arbitrary file from a directory.
The default configuration when all Azul Zulu Prime JVMs use the same cache is beneficial because the JVMs can reuse each other’s compilations when all JVM instances running on the same machine use the same cache. To avoid the slowdown of the Compile Stashing read, write, and lookup functions, make sure the cache file system is fast (for example, stored locally).
Populating Compile Stashing
To populate the cache, use the -XX:+FalconUseCompileStashing
command-line option. You can adjust the cache size using the -XX:FalconMaxCacheSize=<size in number GB>
option, where number is how many gigabytes you allocate for your cache.
Compile Stashing writes compiled code to the file system to access it again for the next run of Azul Zulu Prime JVM. By default it writes up to 10 GB of data to the file system at $HOME/.zing/falcon-cache/<zvm_version>/
so you must provide enough free space in $HOME
. If the home directory is smaller than 10 GB, use the -XX:FalconObjectCacheRoot=<path>
command-line option to change the default location or disable Compile Stashing.
Compile Stashing can work without ReadyNow. However, if both are enabled, the startup time is significantly reduced.
Command-Line Options for Compile Stashing
Use the following command-line options to control caching and enable reporting:
Compile Stashing Command-Line Options
Command-Line Option | Description |
---|---|
|
Enables Compile Stashing, populates the cache. Default value: |
|
Sets the cache location. The default value is |
|
Disables Compile Stashing, populates the cache. |
|
Enables loading from compile cache. |
|
Enables saving to compile cache. |
|
Specifies the maximum size of a stashed compile entry. When running multiple virtual machines concurrently, different cache sizes for different virtual machines are not recommended. Similar cache sizes are advised. |
|
Specifies the maximum size of the compile cache (10 GB by default). |
|
Prints stashing statistics. |
|
Prints stashing report at the end of ReadyNow precompilation. |
When printing stashing statistics is enabled, it is included in the cumulative report as shown in the sample below:
Stashing Final:
Compiles performed: 2204
Estimated compile time win: 0.0s
Estimated avg. compile time win: -nans
Biggest compile time win: 0.0s
Matches attempted: 2204 (100.0%)
Reads excluded via compile command: 0
Succeeded to match: 0 (0.0%)
Missing in cache: 408 (18.5%)
Cache found but did not match: 1796 (81.5%)
Added to cache: 0 (0.0%)
Writes excluded via compile command: 0
Lookup errors: 0
Write errors: 0