-XX:[+|-]PortableSharedCache

Use this command line option to choose whether AOT-compiled code should be portable.

This option, when enabled, increases the portability of AOT-compiled code, in the following ways:

This feature is particularly relevant for packaging a shared classes cache into a container image (for example, applications deployed on the cloud in the form of Docker containers) due to the following reasons: - The processor on which the container image is built is likely to be different from the processor on which the container is deployed. - In a multi-layered container image where the shared classes cache is multi-layered as well, the AOT-compiled code in shared classes cache will likely come from multiple OpenJ9 VMs with different heap size requirements.

Syntax

    -XX:[+|-]PortableSharedCache
Setting Effect Default
-XX:+PortableSharedCache Enable See notes that follow
-XX:-PortableSharedCache Disable

Default settings

This option is enabled by default in containers. To disable the option in a container, specify -XX:-PortableSharedCache.

The option is disabled by default outside containers. To enable the option outside a container, specify -XX:+PortableSharedCache for the initial JVM instance (when the creation of the shared classes cache happens) as well as for every subsequent instance that makes use of the same shared classes cache.