Using Compile Stashing
Compile Stashing is an Azul Zing Builds of OpenJDK (Zing) feature that caches compilations 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.
Note
|
Compile Stashing has been disabled by default since 23.01, even when using ReadyNow. Existing ReadyNow users that want to maintain the same compile stashing behavior as in earlier releases should ensure the -XX:+FalconUseCompileStashing flag is set.
|
Usage Recommendations
It is recommended to use Compile Stashing with ReadyNow for the best results.
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 Zing 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 bytes>
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 Zing. 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
For the full list of Command Line Options for Compile Stashing, see Command Line Option, Compile Stashing Options.
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