Class SharedClassCacheInfo

java.lang.Object
com.ibm.oti.shared.SharedClassCacheInfo

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

    • JVMLEVEL_JAVA5

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

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

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

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

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

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

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

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

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

      public static final int COMPRESSED_REFS_UNKNOWN
      The compressedRefs mode is unknown for the cache.
      See Also:
  • Method Details

    • 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.
    • getCacheType

      public int getCacheType()
      Check the type of the shared class cache.
      Returns:
      Either SharedClassUtilities.PERSISTENT, SharedClassUtilities.NONPERSISTENT or SharedClassUtilities.SNAPSHOT
    • 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
    • getCacheCompressedRefsMode

      public int getCacheCompressedRefsMode()
      Get the compressedRefs mode for the shared class cache.
      Returns:
      Either COMPRESSED_REFS or NON_COMPRESSED_REFS or COMPRESSED_REFS_UNKNOWN
    • 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