Specifies the size for a new shared class cache. Use this option together with the -Xscmx option to set actual and soft maximum size limits respectively.


Setting Value Default
<size> [1[k|K|m|M|g|G] or greater]

See Using -X command-line options for more information about the <size> parameter.

When you use this option with the -Xscmx option, the -Xscmx option sets the soft maximum size, and the -XX:SharedCacheHardLimit option sets the actual size, of a new shared class cache. For more information, see -Xscmx.

If you use this option without the -Xscmx option, the behavior is the same as using the -Xscmx option by itself; both options set the actual size of the shared class cache.

For more information about cache sizes, see Cache size limits.


The following settings, when used together, set the soft maximum size of the shared classes cache to 16 MB and the actual maximum cache size to 64 MB.

-XX:SharedCacheHardLimit=64m -Xscmx16m

See also