Class ExtendedMemoryMXBeanImpl
java.lang.Object
com.ibm.lang.management.internal.ExtendedMemoryMXBeanImpl
- All Implemented Interfaces:
MemoryMXBean, MemoryMXBean, PlatformManagedObject, NotificationBroadcaster, NotificationEmitter
Runtime type for
MemoryMXBean
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addNotificationListener
(NotificationListener listener, NotificationFilter filter, Object handback) Adds a listener to this MBean.void
gc()
Requests the virtual machine to run the system garbage collector.int
Returns a list of all of the instances ofGarbageCollectorMXBean
in this virtual machine.long
long
Returns the current memory usage of the heap for both live objects and for objects no longer in use which are awaiting garbage collection.static ExtendedMemoryMXBeanImpl
long
long
int
getMemoryManagerMXBeans
(boolean copy) Retrieves the list of memory manager beans in the system.getMemoryPoolMXBeans
(boolean copy) Retrieves the list of memory pool beans managed by this manager.long
Returns the current non-heap memory usage for the virtual machine.Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.Returns anObjectName
instance representing the object name of this platform managed object.int
Returns the number of objects in the virtual machine that are awaiting finalization.long
long
long
long
long
long
long
long
long
long
boolean
boolean
Returns a boolean indication of whether or not the memory system is producing verbose output.protected GarbageCollectorMXBean
makeGCBean
(String domainName, String name, int internalID) Create a new GarbageCollectorMXBean.protected MemoryPoolMXBean
makeMemoryPoolBean
(String name, MemoryType type, int internalID) Create a new MemoryPoolMXBean.final void
Removes a listener from this MBean.final void
removeNotificationListener
(NotificationListener listener, NotificationFilter filter, Object handback) Removes a listener from this MBean.final void
sendNotification
(Notification notification) Send notifications to registered listeners.void
setMaxHeapSize
(long size) boolean
setSharedClassCacheMaxAotBytes
(long value) boolean
setSharedClassCacheMaxJitDataBytes
(long value) boolean
setSharedClassCacheMinAotBytes
(long value) boolean
setSharedClassCacheMinJitDataBytes
(long value) boolean
setSharedClassCacheSoftmxBytes
(long value) void
setVerbose
(boolean value) Updates the verbose output setting of the memory system.protected void
Ensure the notification thread is running.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface MemoryMXBean
getCurrentGCThreads, getGCMainThreadCpuUsed, getGCMode, getGCWorkerThreadsCpuUsed, getMaxHeapSize, getMaxHeapSizeLimit, getMaximumGCThreads, getMinHeapSize, getSharedClassCacheFreeSpace, getSharedClassCacheMaxAotBytes, getSharedClassCacheMaxAotUnstoredBytes, getSharedClassCacheMaxJitDataBytes, getSharedClassCacheMaxJitDataUnstoredBytes, getSharedClassCacheMinAotBytes, getSharedClassCacheMinJitDataBytes, getSharedClassCacheSize, getSharedClassCacheSoftmxBytes, getSharedClassCacheSoftmxUnstoredBytes, isSetMaxHeapSizeSupported, setMaxHeapSize, setSharedClassCacheMaxAotBytes, setSharedClassCacheMaxJitDataBytes, setSharedClassCacheMinAotBytes, setSharedClassCacheMinJitDataBytes, setSharedClassCacheSoftmxBytes
Methods declared in interface MemoryMXBean
gc, getHeapMemoryUsage, getNonHeapMemoryUsage, getObjectPendingFinalizationCount, isVerbose, setVerbose
Methods declared in interface PlatformManagedObject
getObjectName
-
Method Details
-
getInstance
-
addNotificationListener
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException Adds a listener to this MBean.- Specified by:
addNotificationListener
in interfaceNotificationBroadcaster
- 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
Create a new GarbageCollectorMXBean.- Parameters:
domainName
- the domain name of the new beanname
- the collector nameinternalID
- an internal id number representing the collector- Returns:
- the new GarbageCollectorMXBean
-
makeMemoryPoolBean
Create a new MemoryPoolMXBean.- Parameters:
name
- the name of the memory pooltype
- the type of the memory poolinternalID
- an internal id number representing the memory pool- Returns:
- the new MemoryPoolMXBean
-
getMemoryManagerMXBeans
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
Returns a list of all of the instances ofGarbageCollectorMXBean
in this virtual machine. Owing to the dynamic nature of this kind ofMXBean
, it is possible that instances may be created or destroyed between the invocation and return of this method.- Returns:
- a list of all known
GarbageCollectorMXBean
s in this virtual machine.
-
getMemoryPoolMXBeans
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 interfaceMemoryMXBean
-
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 interfaceMemoryMXBean
- Returns:
- an instance of
MemoryUsage
which can be interrogated by the caller.
-
getNonHeapMemoryUsage
Returns the current non-heap memory usage for the virtual machine.- Specified by:
getNonHeapMemoryUsage
in interfaceMemoryMXBean
- 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 interfaceMemoryMXBean
- 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 interfaceMemoryMXBean
- 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 interfaceMemoryMXBean
- 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
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 interfaceNotificationBroadcaster
- Returns:
- the array of possible notifications.
-
getGCMode
-
getGCMainThreadCpuUsed
public long getGCMainThreadCpuUsed() -
getGCWorkerThreadsCpuUsed
public long getGCWorkerThreadsCpuUsed() -
getMaximumGCThreads
public int getMaximumGCThreads() -
getCurrentGCThreads
public int getCurrentGCThreads() -
getObjectName
Returns anObjectName
instance representing the object name of this platform managed object.- Specified by:
getObjectName
in interfacePlatformManagedObject
- 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 interfaceNotificationBroadcaster
- 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
, andhandback
parameters. If there is more than one such listener, only one is removed.The
filter
andhandback
parameters may be null if and only if they are null in a listener to be removed.- Specified by:
removeNotificationListener
in interfaceNotificationEmitter
- 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
Send notifications to registered listeners.- Parameters:
notification
- a notification to be sent
-