Cache size limits

The maximum theoretical cache size is 2 GB.

AIX cache sizes

The size of cache you can specify is limited by the amount of physical memory and paging space available to the system.

The shared class cache consists of memory mapped files that are created on disk and remain when the operating system is restarted. If you change the default behavior by using the -Xshareclasses:nonpersistent option, so that the cache is not retained on restart, the cache for sharing classes is allocated by using the System V IPC shared memory mechanism.

You can find these settings by looking at the/proc/sys/kernel/shmmax file. SHMMAX is typically set to 30 MB.

Because the virtual address space of a process is shared between the shared classes cache and the Java™ heap, if you increase the maximum size of the Java heap you might reduce the size of the shared classes cache you can create.

Linux cache sizes

The size of cache you can specify is limited by the amount of physical memory and paging space available to the system.

The shared class cache consists of memory mapped files that are created on disk and remain when the operating system is restarted. If you change the default behavior by using the -Xshareclasses:nonpersistent option, so that the cache is not retained on restart, the cache for sharing classes is allocated by using the System V IPC shared memory mechanism. In this case, on Linux® only, cache size is limited by SHMMAX settings, which limits the amount of shared memory that can be allocated.

You can find these settings by looking at the/proc/sys/kernel/shmmax file. SHMMAX is typically set to 30 MB.

Because the virtual address space of a process is shared between the shared classes cache and the Java heap, if you increase the maximum size of the Java heap you might reduce the size of the shared classes cache you can create.

Windows cache sizes

The size of the cache that you can specify is limited by the amount of available disk space and available virtual address space.

The cache is limited by the following factors:
  • Available disk space. A file is created to store the class data in a directory called javasharedresources. This directory is created in the user's profile directory, which is typically C:\Documents and Settings\<username>\Local Settings\Application Data\javasharedresources\. The shared file is deleted every time Windows is restarted.
  • Available virtual address space. Because the virtual address space of a process is shared between the shared classes cache and the Java heap, increasing the maximum size of the Java heap reduces the size of the shared classes cache you can create.

z/OS® cache sizes

The size of cache you can specify is limited by the amount of swap space available to the system.

Because the virtual address space of a process is shared between the shared classes cache and the Java heap, if you increase the maximum size of the Java heap you might reduce the size of the shared classes cache you can create.