Class ExtendedMemoryMXBeanImpl

java.lang.Object
com.ibm.lang.management.internal.ExtendedMemoryMXBeanImpl
All Implemented Interfaces:
MemoryMXBean, MemoryMXBean, PlatformManagedObject, NotificationBroadcaster, NotificationEmitter

public final class ExtendedMemoryMXBeanImpl extends Object implements MemoryMXBean
Runtime type for MemoryMXBean.
  • Method Details

    • getInstance

      public static ExtendedMemoryMXBeanImpl getInstance()
    • addNotificationListener

      public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
      Adds a listener to this MBean.
      Specified by:
      addNotificationListener in interface NotificationBroadcaster
      Parameters:
      listener - The listener object which will handle the notifications emitted by the broadcaster.
      filter - The filter object. If filter is null, no filtering will be performed before handling notifications.
      handback - An opaque object to be sent back to the listener when a notification is emitted. This object cannot be used by the Notification broadcaster object. It should be resent unchanged with the notification to the listener.
      Throws:
      IllegalArgumentException - Listener parameter is null.
      See Also:
    • startNotificationThread

      protected void startNotificationThread()
      Ensure the notification thread is running.
    • makeGCBean

      protected GarbageCollectorMXBean makeGCBean(String domainName, String name, int internalID)
      Create a new GarbageCollectorMXBean.
      Parameters:
      domainName - the domain name of the new bean
      name - the collector name
      internalID - an internal id number representing the collector
      Returns:
      the new GarbageCollectorMXBean
    • makeMemoryPoolBean

      protected MemoryPoolMXBean makeMemoryPoolBean(String name, MemoryType type, int internalID)
      Create a new MemoryPoolMXBean.
      Parameters:
      name - the name of the memory pool
      type - the type of the memory pool
      internalID - an internal id number representing the memory pool
      Returns:
      the new MemoryPoolMXBean
    • getMemoryManagerMXBeans

      public List<MemoryManagerMXBean> getMemoryManagerMXBeans(boolean copy)
      Retrieves the list of memory manager beans in the system.
      Parameters:
      copy - indicates whether a copy of the list should be returned
      Returns:
      the list of MemoryManagerMXBean instances
    • getGarbageCollectorMXBeans

      public List<GarbageCollectorMXBean> getGarbageCollectorMXBeans()
      Returns a list of all of the instances of GarbageCollectorMXBean in this virtual machine. Owing to the dynamic nature of this kind of MXBean, it is possible that instances may be created or destroyed between the invocation and return of this method.
      Returns:
      a list of all known GarbageCollectorMXBeans in this virtual machine.
    • getMemoryPoolMXBeans

      public List<MemoryPoolMXBean> getMemoryPoolMXBeans(boolean copy)
      Retrieves the list of memory pool beans managed by this manager.
      Parameters:
      copy - indicates whether a copy of the list should be returned
      Returns:
      the list of MemoryPoolMXBean instances
    • gc

      public void gc()
      Requests the virtual machine to run the system garbage collector.
      Specified by:
      gc in interface MemoryMXBean
    • getHeapMemoryUsage

      public MemoryUsage getHeapMemoryUsage()
      Returns the current memory usage of the heap for both live objects and for objects no longer in use which are awaiting garbage collection.
      Specified by:
      getHeapMemoryUsage in interface MemoryMXBean
      Returns:
      an instance of MemoryUsage which can be interrogated by the caller.
    • getNonHeapMemoryUsage

      public MemoryUsage getNonHeapMemoryUsage()
      Returns the current non-heap memory usage for the virtual machine.
      Specified by:
      getNonHeapMemoryUsage in interface MemoryMXBean
      Returns:
      an instance of MemoryUsage which can be interrogated by the caller.
    • getObjectPendingFinalizationCount

      public int getObjectPendingFinalizationCount()
      Returns the number of objects in the virtual machine that are awaiting finalization. The returned value should only be used as an approximate guide.
      Specified by:
      getObjectPendingFinalizationCount in interface MemoryMXBean
      Returns:
      the number of objects awaiting finalization.
    • isVerbose

      public boolean isVerbose()
      Returns a boolean indication of whether or not the memory system is producing verbose output.
      Specified by:
      isVerbose in interface MemoryMXBean
      Returns:
      true if verbose output is being produced ; false otherwise.
    • setVerbose

      public void setVerbose(boolean value)
      Updates the verbose output setting of the memory system.
      Specified by:
      setVerbose in interface MemoryMXBean
      Parameters:
      value - true enables verbose output ; false disables verbose output.
    • getMaxHeapSizeLimit

      public long getMaxHeapSizeLimit()
    • getMaxHeapSize

      public long getMaxHeapSize()
    • getMinHeapSize

      public long getMinHeapSize()
    • setMaxHeapSize

      public void setMaxHeapSize(long size)
    • isSetMaxHeapSizeSupported

      public boolean isSetMaxHeapSizeSupported()
    • getNotificationInfo

      public MBeanNotificationInfo[] getNotificationInfo()

      Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.

      It is not illegal for the MBean to send notifications not described in this array. However, some clients of the MBean server may depend on the array being complete for their correct functioning.

      Specified by:
      getNotificationInfo in interface NotificationBroadcaster
      Returns:
      the array of possible notifications.
    • getSharedClassCacheSize

      public long getSharedClassCacheSize()
    • getSharedClassCacheSoftmxBytes

      public long getSharedClassCacheSoftmxBytes()
    • getSharedClassCacheMinAotBytes

      public long getSharedClassCacheMinAotBytes()
    • getSharedClassCacheMaxAotBytes

      public long getSharedClassCacheMaxAotBytes()
    • getSharedClassCacheMinJitDataBytes

      public long getSharedClassCacheMinJitDataBytes()
    • getSharedClassCacheMaxJitDataBytes

      public long getSharedClassCacheMaxJitDataBytes()
    • setSharedClassCacheSoftmxBytes

      public boolean setSharedClassCacheSoftmxBytes(long value)
    • setSharedClassCacheMinAotBytes

      public boolean setSharedClassCacheMinAotBytes(long value)
    • setSharedClassCacheMaxAotBytes

      public boolean setSharedClassCacheMaxAotBytes(long value)
    • setSharedClassCacheMinJitDataBytes

      public boolean setSharedClassCacheMinJitDataBytes(long value)
    • setSharedClassCacheMaxJitDataBytes

      public boolean setSharedClassCacheMaxJitDataBytes(long value)
    • getSharedClassCacheSoftmxUnstoredBytes

      public long getSharedClassCacheSoftmxUnstoredBytes()
    • getSharedClassCacheMaxAotUnstoredBytes

      public long getSharedClassCacheMaxAotUnstoredBytes()
    • getSharedClassCacheMaxJitDataUnstoredBytes

      public long getSharedClassCacheMaxJitDataUnstoredBytes()
    • getSharedClassCacheFreeSpace

      public long getSharedClassCacheFreeSpace()
    • getGCMode

      public String getGCMode()
    • getGCMainThreadCpuUsed

      public long getGCMainThreadCpuUsed()
    • getGCWorkerThreadsCpuUsed

      public long getGCWorkerThreadsCpuUsed()
    • getMaximumGCThreads

      public int getMaximumGCThreads()
    • getCurrentGCThreads

      public int getCurrentGCThreads()
    • getObjectName

      public ObjectName getObjectName()
      Returns an ObjectName instance representing the object name of this platform managed object.
      Specified by:
      getObjectName in interface PlatformManagedObject
      Returns:
      an ObjectName instance representing the object name of this platform managed object.
    • removeNotificationListener

      public final void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
      Removes a listener from this MBean. If the listener has been registered with different handback objects or notification filters, all entries corresponding to the listener will be removed.
      Specified by:
      removeNotificationListener in interface NotificationBroadcaster
      Parameters:
      listener - A listener that was previously added to this MBean.
      Throws:
      ListenerNotFoundException - The listener is not registered with the MBean.
      See Also:
    • removeNotificationListener

      public final void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException

      Removes a listener from this MBean. The MBean must have a listener that exactly matches the given listener, filter, and handback parameters. If there is more than one such listener, only one is removed.

      The filter and handback parameters may be null if and only if they are null in a listener to be removed.

      Specified by:
      removeNotificationListener in interface NotificationEmitter
      Parameters:
      listener - A listener that was previously added to this MBean.
      filter - The filter that was specified when the listener was added.
      handback - The handback that was specified when the listener was added.
      Throws:
      ListenerNotFoundException - The listener is not registered with the MBean, or it is not registered with the given filter and handback.
    • sendNotification

      public final void sendNotification(Notification notification)
      Send notifications to registered listeners.
      Parameters:
      notification - a notification to be sent