public interface MemoryPoolMXBean extends PlatformManagedObject
MemoryManagerMXBean
.
In any given Java virtual machine there can be at one or more instances of
this interface. Each may be distinguished by their separate
ObjectName
value.
Accessing this kind of MXBean
can be done in one of three
ways.
ManagementFactory.getMemoryPoolMXBeans()
method which returns a List
of all currently instantiated
MemoryPoolMXBeans.MBeanServerConnection
.ManagementFactory.newPlatformMXBeanProxy(javax.management.MBeanServerConnection, java.lang.String, java.lang.Class<T>)
method, passing in the
string "java.lang:type=MemoryPool,name= unique memory pool name
" for the value of the second parameter.Modifier and Type | Method and Description |
---|---|
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.
|
String[] |
getMemoryManagerNames()
Returns a string array containing the unique names of each memory manager
that manages this memory pool.
|
String |
getName()
Returns the name of this memory pool.
|
MemoryUsage |
getPeakUsage()
Returns information on the peak usage of the memory pool.
|
MemoryType |
getType()
Returns the memory pool's type.
|
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.
|
getObjectName
MemoryUsage getCollectionUsage()
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.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.long getCollectionUsageThreshold()
UnsupportedOperationException
- if the memory pool does not support a collection usage
threshold.isCollectionUsageThresholdSupported()
long getCollectionUsageThresholdCount()
UnsupportedOperationException
- if the memory pool does not support a collection usage
threshold.isCollectionUsageThresholdSupported()
String[] getMemoryManagerNames()
String getName()
MemoryUsage getPeakUsage()
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).resetPeakUsage()
,
isValid()
MemoryType getType()
MemoryType
value indicating the type of the memory pool
(heap or non-heap).MemoryUsage getUsage()
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).isValid()
long getUsageThreshold()
UnsupportedOperationException
- if the memory pool does not support a usage threshold.isUsageThresholdSupported()
,
setUsageThreshold(long)
long getUsageThresholdCount()
UnsupportedOperationException
- if the memory pool does not support a usage threshold.isUsageThresholdSupported()
boolean isCollectionUsageThresholdExceeded()
true
if the collection usage threshold was
surpassed after the latest garbage collection run, otherwise
false
.UnsupportedOperationException
- if the memory pool does not support a collection usage
threshold.isCollectionUsageThresholdSupported()
boolean isCollectionUsageThresholdSupported()
true
if supported, false
otherwise.boolean isUsageThresholdExceeded()
true
if the usage threshold has been surpassed,
otherwise false
.UnsupportedOperationException
- if the memory pool does not support a usage threshold.isUsageThresholdSupported()
boolean isUsageThresholdSupported()
true
if supported, false
otherwise.boolean isValid()
true
if the memory pool has not been removed by
the virtual machine, false
otherwise.void resetPeakUsage()
SecurityException
- if there is a security manager active and the method caller
does not have ManagementPermission "control".ManagementPermission
void setCollectionUsageThreshold(long threshold)
threshold
- the size of the new collection usage threshold expressed in
bytes.UnsupportedOperationException
- if the memory pool does not support a collection usage
threshold.IllegalArgumentException
- if input value threshold
is either negative or
else is in excess of any maximum memory size that may have
been defined for this memory pool.SecurityException
- if there is a security manager active and the method caller
does not have ManagementPermission
"control".void setUsageThreshold(long threshold)
threshold
- the size of the new usage threshold expressed in bytes.UnsupportedOperationException
- if the memory pool does not support a usage threshold.IllegalArgumentException
- if input value threshold
is either negative or
else is in excess of any maximum memory size that may have
been defined for this memory pool.SecurityException
- if there is a security manager active and the method caller
does not have ManagementPermission
"control".Eclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 1993, 2023 IBM Corp. and others.