Class SharedClassCacheInfo


  • public class SharedClassCacheInfo
    extends Object
    SharedClassCacheInfo stores information about a shared class cache and provides methods to retrieve that information.
    • Field Detail

      • JVMLEVEL_JAVA5

        public static final int JVMLEVEL_JAVA5
        Specifies a Java 5 cache.
        See Also:
        Constant Field Values
      • JVMLEVEL_JAVA6

        public static final int JVMLEVEL_JAVA6
        Specifies a Java 6 cache.
        See Also:
        Constant Field Values
      • JVMLEVEL_JAVA7

        public static final int JVMLEVEL_JAVA7
        Specifies a Java 7 cache.
        See Also:
        Constant Field Values
      • JVMLEVEL_JAVA8

        public static final int JVMLEVEL_JAVA8
        Specifies a Java 8 cache.
        See Also:
        Constant Field Values
      • JVMLEVEL_JAVA9

        public static final int JVMLEVEL_JAVA9
        Specifies a Java 9 cache.
        See Also:
        Constant Field Values
      • ADDRESS_MODE_32

        public static final int ADDRESS_MODE_32
        Specifies a 32-bit cache.
        See Also:
        Constant Field Values
      • ADDRESS_MODE_64

        public static final int ADDRESS_MODE_64
        Specifies a 64-bit cache.
        See Also:
        Constant Field Values
      • COMPRESSED_REFS

        public static final int COMPRESSED_REFS
        Specifies a compressedRefs cache.
        See Also:
        Constant Field Values
      • NON_COMPRESSED_REFS

        public static final int NON_COMPRESSED_REFS
        Specifies a non-compressedRefs cache.
        See Also:
        Constant Field Values
      • COMPRESSED_REFS_UNKNOWN

        public static final int COMPRESSED_REFS_UNKNOWN
        The compressedRefs mode is unknown for the cache.
        See Also:
        Constant Field Values
    • Method Detail

      • getCacheName

        public String getCacheName()
        Gets the cache name for the shared class cache.
        Returns:
        Name of the shared class cache.
      • isCacheCompatible

        public boolean isCacheCompatible()
        Checks the compatibility of the shared class cache with this JVM.
        Returns:
        true if cache is compatible with this JVM, false otherwise.
      • isCachePersistent

        @Deprecated
        public boolean isCachePersistent()
        Deprecated.
        Use getCacheType() instead.
        Checks if the shared class cache is persistent.
        Returns:
        true if cache is persistent, false otherwise.
      • getOSshmid

        public int getOSshmid()
        Gets the OS shared memory ID associated with the shared class cache.
        Returns:
        A valid value if cache is non-persistent and shared memory id is available, else -1.
      • getOSsemid

        public int getOSsemid()
        Gets the OS semaphore ID associated with the shared class cache.
        Returns:
        A valid value if cache is non-persistent and semaphore id is available, else -1.
      • getLastDetach

        public Date getLastDetach()
        Gets the time when the shared class cache was last detached.
        Returns:
        Date, or null if last detach time is not available.
      • getCacheJVMLevel

        public int getCacheJVMLevel()
        Gets the JVM level for the shared class cache. Starting from Java 10, the JVM LEVEL equals to the java version number on which the share class cache is created.
        Returns:
        A JVMLEVEL constant.
      • getCacheAddressMode

        public int getCacheAddressMode()
        Gets the address mode for the shared class cache.
        Returns:
        Either ADDRESS_MODE_32 or ADDRESS_MODE_64
      • isCacheCorrupt

        public boolean isCacheCorrupt()
        Checks if the shared class cache is corrupt.
        Returns:
        true if the cache is corrupt, false otherwise.
      • getCacheSize

        public long getCacheSize()
        Gets total usable shared class cache size. Returns -1 if cache is incompatible.
        Returns:
        Number of usable bytes in cache.
      • getCacheFreeBytes

        public long getCacheFreeBytes()
        Gets the amount of free bytes in the shared class cache. Returns -1 if cache is incompatible.
        Returns:
        long
      • getCacheSoftMaxBytes

        public long getCacheSoftMaxBytes()
        Get the soft limit for available space in the cache in bytes. Returns -1 if cache is incompatible or cache size if it is not set.
        Returns:
        long
      • getCacheLayer

        public int getCacheLayer()
        Get the layer number for the shared class cache.
        Returns:
        The shared cache layer number or -1 if the shared cache does not have a layer number