public final class MemoryPoolMXBeanImpl extends DynamicMXBeanImpl implements MemoryPoolMXBean
MemoryPoolMXBeaninfo| Modifier and Type | Method and Description |
|---|---|
java.lang.management.MemoryUsage |
getCollectionUsage()
If supported by the virtual machine, returns a
MemoryUsagewhich
encapsulates this memory pool's memory usage after the most recent run of
the garbage collector. |
long |
getCollectionUsageThreshold()
Returns this memory pool's collection usage threshold.
|
long |
getCollectionUsageThresholdCount()
Returns the number of times that the memory usage for this memory pool
has grown to exceed the collection usage threshold.
|
java.lang.String[] |
getMemoryManagerNames()
Returns a string array containing the unique names of each memory manager
that manages this memory pool.
|
java.lang.String |
getName()
Returns the name of this memory pool.
|
java.lang.management.MemoryUsage |
getPeakUsage()
Returns information on the peak usage of the memory pool.
|
java.lang.management.MemoryUsage |
getPreCollectionUsage()
If supported by the virtual machine, returns a
MemoryUsagewhich
encapsulates this memory pool's memory usage before the most
recent run of the garbage collector. |
java.lang.management.MemoryType |
getType()
Returns the memory pool's type.
|
java.lang.management.MemoryUsage |
getUsage()
Returns the current memory usage of this memory pool as estimated by the
virtual machine.
|
long |
getUsageThreshold()
Returns this memory pool's usage threshold.
|
long |
getUsageThresholdCount()
Returns the number of times that the memory usage for this memory pool
has grown to exceed the current usage threshold.
|
boolean |
isCollectionUsageThresholdExceeded()
Returns a boolean indication of whether or not this memory pool hit or
exceeded the current value of the collection usage threshold after the
latest garbage collection run.
|
boolean |
isCollectionUsageThresholdSupported()
Returns a boolean indication of whether or not this memory pool supports
a collection usage threshold.
|
boolean |
isUsageThresholdExceeded()
Returns a boolean indication of whether or not this memory pool has hit
or has exceeded the current value of the usage threshold.
|
boolean |
isUsageThresholdSupported()
Returns a boolean indication of whether or not this memory pool supports
a usage threshold.
|
boolean |
isValid()
Returns a boolean indication of whether or not this memory pool may still
be considered valid.
|
void |
resetPeakUsage()
Updates this memory pool's memory usage peak value to be whatever the
value of the current memory usage is.
|
void |
setCollectionUsageThreshold(long threshold)
Updates this memory pool to have a new value for its collection usage
threshold.
|
void |
setUsageThreshold(long threshold)
Updates this memory pool to have a new value for its usage threshold.
|
getAttribute, getAttributes, getMBeanInfo, getPresentAttribute, getPresentOperation, initMBeanInfo, invoke, setAttribute, setAttributes, setMBeanInfopublic java.lang.management.MemoryUsage getCollectionUsage()
java.lang.management.MemoryPoolMXBeanMemoryUsagewhich
encapsulates this memory pool's memory usage after the most recent run of
the garbage collector. No garbage collection will be actually occur as a
result of this method getting called.getCollectionUsage in interface java.lang.management.MemoryPoolMXBeanMemoryUsageobject that may be interrogated by the
caller to determine the details of the memory usage. Returns
null if the virtual machine does not support this
method.public java.lang.management.MemoryUsage getPreCollectionUsage()
MemoryPoolMXBeanMemoryUsagewhich
encapsulates this memory pool's memory usage before the most
recent run of the garbage collector. No garbage collection will be
actually occur as a result of this method getting called.
The method will return a null if the virtual machine does
not support this type of functionality.
CompositeData with attributes as
specified in MemoryUsage.MemoryUsage containing the usage details for the memory
pool just before the most recent collection occurred.public long getCollectionUsageThreshold()
java.lang.management.MemoryPoolMXBeangetCollectionUsageThreshold in interface java.lang.management.MemoryPoolMXBeanMemoryPoolMXBean.isCollectionUsageThresholdSupported()public long getCollectionUsageThresholdCount()
java.lang.management.MemoryPoolMXBeangetCollectionUsageThresholdCount in interface java.lang.management.MemoryPoolMXBeanMemoryPoolMXBean.isCollectionUsageThresholdSupported()public java.lang.String[] getMemoryManagerNames()
java.lang.management.MemoryPoolMXBeangetMemoryManagerNames in interface java.lang.management.MemoryPoolMXBeanpublic java.lang.String getName()
java.lang.management.MemoryPoolMXBeangetName in interface java.lang.management.MemoryPoolMXBeanpublic java.lang.management.MemoryUsage getPeakUsage()
java.lang.management.MemoryPoolMXBeangetPeakUsage in interface java.lang.management.MemoryPoolMXBeanMemoryUsagewhich can be interrogated by the caller to
determine details of the peak memory usage. A null
value will be returned if the memory pool no longer exists (and
the pool is therefore considered to be invalid).MemoryPoolMXBean.resetPeakUsage(),
MemoryPoolMXBean.isValid()public java.lang.management.MemoryType getType()
java.lang.management.MemoryPoolMXBeangetType in interface java.lang.management.MemoryPoolMXBeanMemoryTypevalue indicating the type of the memory pool
(heap or non-heap).public java.lang.management.MemoryUsage getUsage()
java.lang.management.MemoryPoolMXBeangetUsage in interface java.lang.management.MemoryPoolMXBeanMemoryUsagethat can be interrogated by
the caller to determine details on the pool's current memory
usage. A null value will be returned if the memory
pool no longer exists (in which case it is considered to be
invalid).MemoryPoolMXBean.isValid()public long getUsageThreshold()
java.lang.management.MemoryPoolMXBeangetUsageThreshold in interface java.lang.management.MemoryPoolMXBeanMemoryPoolMXBean.isUsageThresholdSupported(),
MemoryPoolMXBean.setUsageThreshold(long)public long getUsageThresholdCount()
java.lang.management.MemoryPoolMXBeangetUsageThresholdCount in interface java.lang.management.MemoryPoolMXBeanMemoryPoolMXBean.isUsageThresholdSupported()public boolean isCollectionUsageThresholdExceeded()
java.lang.management.MemoryPoolMXBeanisCollectionUsageThresholdExceeded in interface java.lang.management.MemoryPoolMXBeantrue if the collection usage threshold was
surpassed after the latest garbage collection run, otherwise
false.MemoryPoolMXBean.isCollectionUsageThresholdSupported()public boolean isCollectionUsageThresholdSupported()
java.lang.management.MemoryPoolMXBeanisCollectionUsageThresholdSupported in interface java.lang.management.MemoryPoolMXBeantrue if supported, false otherwise.public boolean isUsageThresholdExceeded()
java.lang.management.MemoryPoolMXBeanisUsageThresholdExceeded in interface java.lang.management.MemoryPoolMXBeantrue if the usage threshold has been surpassed,
otherwise false.MemoryPoolMXBean.isUsageThresholdSupported()public boolean isUsageThresholdSupported()
java.lang.management.MemoryPoolMXBeanisUsageThresholdSupported in interface java.lang.management.MemoryPoolMXBeantrue if supported, false otherwise.public boolean isValid()
java.lang.management.MemoryPoolMXBeanisValid in interface java.lang.management.MemoryPoolMXBeantrue if the memory pool has not been removed by
the virtual machine, false otherwise.public void resetPeakUsage()
java.lang.management.MemoryPoolMXBeanresetPeakUsage in interface java.lang.management.MemoryPoolMXBeanManagementPermissionpublic void setCollectionUsageThreshold(long threshold)
java.lang.management.MemoryPoolMXBeansetCollectionUsageThreshold in interface java.lang.management.MemoryPoolMXBeanthreshold - the size of the new collection usage threshold expressed in
bytes.public void setUsageThreshold(long threshold)
java.lang.management.MemoryPoolMXBeansetUsageThreshold in interface java.lang.management.MemoryPoolMXBeanthreshold - the size of the new usage threshold expressed in bytes.