public final class MemoryPoolMXBeanImpl extends DynamicMXBeanImpl implements MemoryPoolMXBean
MemoryPoolMXBean
info
Modifier and Type | Method and Description |
---|---|
java.lang.management.MemoryUsage |
getCollectionUsage()
If supported by the virtual machine, returns a
MemoryUsage which
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
MemoryUsage which
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, setMBeanInfo
public java.lang.management.MemoryUsage getCollectionUsage()
java.lang.management.MemoryPoolMXBean
MemoryUsage
which
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.MemoryPoolMXBean
MemoryUsage
object 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()
MemoryPoolMXBean
MemoryUsage
which
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.MemoryPoolMXBean
getCollectionUsageThreshold
in interface java.lang.management.MemoryPoolMXBean
MemoryPoolMXBean.isCollectionUsageThresholdSupported()
public long getCollectionUsageThresholdCount()
java.lang.management.MemoryPoolMXBean
getCollectionUsageThresholdCount
in interface java.lang.management.MemoryPoolMXBean
MemoryPoolMXBean.isCollectionUsageThresholdSupported()
public java.lang.String[] getMemoryManagerNames()
java.lang.management.MemoryPoolMXBean
getMemoryManagerNames
in interface java.lang.management.MemoryPoolMXBean
public java.lang.String getName()
java.lang.management.MemoryPoolMXBean
getName
in interface java.lang.management.MemoryPoolMXBean
public java.lang.management.MemoryUsage getPeakUsage()
java.lang.management.MemoryPoolMXBean
getPeakUsage
in interface java.lang.management.MemoryPoolMXBean
MemoryUsage
which 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.MemoryPoolMXBean
getType
in interface java.lang.management.MemoryPoolMXBean
MemoryType
value indicating the type of the memory pool
(heap or non-heap).public java.lang.management.MemoryUsage getUsage()
java.lang.management.MemoryPoolMXBean
getUsage
in interface java.lang.management.MemoryPoolMXBean
MemoryUsage
that 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.MemoryPoolMXBean
getUsageThreshold
in interface java.lang.management.MemoryPoolMXBean
MemoryPoolMXBean.isUsageThresholdSupported()
,
MemoryPoolMXBean.setUsageThreshold(long)
public long getUsageThresholdCount()
java.lang.management.MemoryPoolMXBean
getUsageThresholdCount
in interface java.lang.management.MemoryPoolMXBean
MemoryPoolMXBean.isUsageThresholdSupported()
public boolean isCollectionUsageThresholdExceeded()
java.lang.management.MemoryPoolMXBean
isCollectionUsageThresholdExceeded
in interface java.lang.management.MemoryPoolMXBean
true
if the collection usage threshold was
surpassed after the latest garbage collection run, otherwise
false
.MemoryPoolMXBean.isCollectionUsageThresholdSupported()
public boolean isCollectionUsageThresholdSupported()
java.lang.management.MemoryPoolMXBean
isCollectionUsageThresholdSupported
in interface java.lang.management.MemoryPoolMXBean
true
if supported, false
otherwise.public boolean isUsageThresholdExceeded()
java.lang.management.MemoryPoolMXBean
isUsageThresholdExceeded
in interface java.lang.management.MemoryPoolMXBean
true
if the usage threshold has been surpassed,
otherwise false
.MemoryPoolMXBean.isUsageThresholdSupported()
public boolean isUsageThresholdSupported()
java.lang.management.MemoryPoolMXBean
isUsageThresholdSupported
in interface java.lang.management.MemoryPoolMXBean
true
if supported, false
otherwise.public boolean isValid()
java.lang.management.MemoryPoolMXBean
isValid
in interface java.lang.management.MemoryPoolMXBean
true
if the memory pool has not been removed by
the virtual machine, false
otherwise.public void resetPeakUsage()
java.lang.management.MemoryPoolMXBean
resetPeakUsage
in interface java.lang.management.MemoryPoolMXBean
ManagementPermission
public void setCollectionUsageThreshold(long threshold)
java.lang.management.MemoryPoolMXBean
setCollectionUsageThreshold
in interface java.lang.management.MemoryPoolMXBean
threshold
- the size of the new collection usage threshold expressed in
bytes.public void setUsageThreshold(long threshold)
java.lang.management.MemoryPoolMXBean
setUsageThreshold
in interface java.lang.management.MemoryPoolMXBean
threshold
- the size of the new usage threshold expressed in bytes.