Back to Zing Documentation Home
Use Compile Stashing
Compile Stashing is a Zing Virtual Machine feature that caches compiles performed in one run and reuses them in subsequent runs.
Compile Stashing used with ReadyNow! effectively reduces compiler start time by 80% and CPU usage by 60%.
It is recommended to use Compile Stashing with ReadyNow! for the best results.
Starting with ZVM 188.8.131.52, Compile Stashing is not enabled by default with the
-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 ZVMs use the same cache is beneficial because the ZVMs can reuse each other's compilations when all ZVMs 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).
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 ZVM. 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
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.
Use the following command-line options to control caching and enable reporting:
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
- Using the Zing Virtual Machine
- Running a Java Application
- Using ZVM Command-Line Options
- Using ZVM with the Falcon Compiler
- Using ReadyNow!
- Using Compact Strings
- Reducing Deoptimizations
- Invoking Zing with Native Application
- Using ZVM Instance Configuration Recommendations
- Using Transport Layer Security (TLS) v1.3
© Azul Systems, Inc. 2020 All rights reserved.