public interface MemoryPoolMXBean
MemoryPoolMXBean
is an interface used by the management
system to access memory pool properties, performn operations and configure thresholds
and notifications.
ObjectName
pattern: com.azul.zing:type=MemoryPool,name=pool_name
In the Zing environment, a portion of RAM is partitioned as Zing Memory for allocating Java Heap by Zing VM processes. Zing VM can also be run in standard environment where its Java Heap is allocated from Linux memory. For a Zing process, instances of the Zing MemoryPoolMXBeans wrap resource accessors for various memory pools. The individual memory pools in the Zing VM has a hierarchical structure that forms a parent-child relationship. Note that some of the memory pools are not applicable for Zing VM running in standard Linux environment.
Pool Name | Description |
---|---|
System Total Memory | System RAM memory |
System Linux Memory | The portion of RAM used by all processes for malloc, mmap |
System Zing Memory | The portion of RAM used by the Java Heap in Zing VM processes |
Java Heap | The process's entire Java heap |
Native Heap | Non Java heap memory use by the process |
GenPauseless New Gen | The New Generation in the Java heap |
GenPauseless Old Gen | The Old Generation in the Java heap |
GenPauseless Perm Gen | The Permanent Generation in the Java heap |
Code Cache | Memory pool used to store the runtime compiler's output |
Java System | Memory pool used by the kernel for process-specific data structures |
Java Internal | Internal pool containing data structures used by the Zing VM |
The MemoryPoolMXBean has entry points to query each memory pool about its
relationship to others.
The getParentPool()
and
getChildPools()
return the parent and child pools for this memory pool. A parent pool is
the pool from which this memory pool obtains its memory. A child pool
represents a memory pool that uses memory in this memory pool to create
a separate memory pool..
Each memory pool is a pool managed at the system level or a pool managed in
the process. The getType()
returns a MemoryType
that
provides the answer about the type of the pool and further distinguishes
between Java Heap and non-Java Heap memory pools types in the process.
The possible types are SYSTEM
and, for the process, either
JAVA_HEAP
or NON_JAVA_HEAP
Each memory pool has methods to describe
how its memory is allocated and managed.
One aspect is returned by calling getMemoryPoolSizeType()
.
Memory pools have either a FIXED
size type that means all
memory is allocated when the memory pool is created and there is no possible
way to expand the pool when more memory is needed. Or, the memory pool has
an ELASTIC
size type. Additional information about ELASTIC
size type
memory pool characteristic is in the documentation
describing the MemoryPoolSizeType
class.
Memory managers for each pool are obtained by calling
getMemoryManagerNames()
. Whether the memory pool is currently valid
can be obtained by using
isValid()
.
The MemoryPoolMXBean provides an interface to access details about each of the individual memory pools. The interface has three alternatives available for a monitoring application to use to collect metrics:
Direct connect | Data is provided directly as a graphable numeric value (long or double) |
Detailed analysis | Data is provided in a returned object containing a snapshot of relevant data |
Threshold and notification | Threshold crossing generates a notification with an object containing a snapshot of relevant data |
The direct connect methods return the memory use as a type long
.
Detailed analysis returns a
MemoryUsage
object with the initial reserved, size, use, and
memory pool size type, FIXED
or ELASTIC
. Here are examples
of each:
Direct connect | getCurrentUse() |
getCurrentSize() |
getInitialReserved() |
Detailed analysis | getCurrentMemoryUsage() |
Methods that have a "MemoryUsage" suffix return a MemoryUsage
object.
Direct connect for monitoring behavior
The getCurrentUse()
method provides the amount of memory in the memory pool that is actively in use.
The getCurrentSize()
method returns the size of the memory pool. For memory pools that are a
FIXED
size type, the size returned is equal to the value returned by getInitialReserved()
.
For ELASTIC
size type memory pools, the size is always greater than
or equal to the value returned by the
getCurrentUse
method.
The getInitialReserved()
method returns the amount of memory initially reserved when the memory
pool is created.
Detailed analysis for in depth analysis and snapshots
For a detailed snapshot of a memory pool, use
getCurrentMemoryUsage()
to return a
MemoryUsage
object.
The data returned is the same as that which you could collect individually
using calls to other methods in the
MemoryPoolMXBean interface. See the MemoryUsage
class for details.
Peak memory usage
The MemoryUsage
getPeakUsage()
method returns the peak memory usage for this memory pool.
To better control the time interval over which the peak is evaluated, you can reset the peak usage using,
resetPeakUsage()
. When multiple users are connected to the process and accessing the MXBeans, use
the getTimeOfLastResetPeakUsageSec()
to determine when the last reset of the peak usage occurred.
Peak end of collection usage
As with peak memory usage, getPeakEndOfCollectionUsage()
returns the peak memory usage, but the data is collected at the end of
a collection for this memory pool.
Because of differences between the memory pools and their memory managers,
the end of collection has different meanings. For the memory pools in the Java
Heap, New Generation, Old Generation and Permanent Generation,
the measurement occurs at the time when the garbage collector for that memory pool
runs. For all other memory pools, the runtime measures the memory usage for each of
the non-garbage collected memory pools
when a garbage collection occurs. This is done to ensure that there is a snapshot of
all the non-garbage collectod memory pools at the time of a collection.
As with all peak measurements, you can control the interval of time over which you wish to sample
by using resetPeakEndOfCollectionUsage()
. When the last reset occurred is available by
calling getTimeOfLastResetPeakEndOfCollectionUsageSec()
.
Start of collection usage
For the last completed collection for this memory pool, if it is a garbage collected memory
pool call getStartOfCollectionUsage()
and getEndOfCollectionUsage()
.to
obtain the data for the last completed collection for that memory pool. For non-garbage
collected memory pools, the value returned is for the last completed garbage collection
for any memory pool that is garbage collected.
The notification types for the MemoryPoolMXBean are also described in
MemoryPoolNotificationInfo
.
Thresholds can be used without notifications and polling can be used to monitor
the values returned by
the *ThresholdExceeded* methods. However, this does not lend
itself to good use of computing resources, so setting up notifications is preferred.
Memory Live Set Size Threshold Exceeded
Set a threshold notification by:
1. Calling setLiveSetSizeThreshold(long)
to specify the maximum size in bytes that you want this live set to be,
at or above which a notification will be generated
|
2. Adding a notification listener for the MXBean to listen for the notification |
The current Live Set Size Threshold for this memory pool is obtained by calling
getLiveSetSizeThreshold()
. The number of times the threshold has been
exceeded is available using getLiveSetSizeThresholdExceededCount()
.
In the interval between the completion of the penultimate garbage collection and
the completion of the last completed garbage collection, find out whether the
threshold has been exceeded using isLiveSetSizeThresholdExceeded()
.
To determine whether this memory pool supports Live Set Size Threshold call
isLiveSetSizeThresholdSupported()
.
Memory After Collection Use Threshold Exceeded
Set a threshold notification by:
1. Calling setAfterCollectionUseThreshold(long)
to specify the maximum size in bytes that you want this memory pool to be
immediately following a collection,
at or above which a notification will be generated
|
2. Adding a notification listener for the MXBean to listen for the notification |
The current After Collection Use Threshold for this memory pool
is obtained by calling getAfterCollectionUseThreshold()
.
The number of times the threshold has been
exceeded is available using getAfterCollectionUseThresholdExceededCount()
.
In the interval between the completion of the penultimate garbage collection and
the completion of the last completed garbage collection,
find out whether the threshold has been
exceeded by using isAfterCollectionUseThresholdExceeded()
.
To determine whether this memory pool supports the Memory
After Collection Use Threshold call
isAfterCollectionUseThresholdSupported()
.
Memory Use Threshold Exceeded
Set a threshold notification by:
1. Calling setUseThreshold(long)
to specify the maximum number of bytes that you want this pool to use,
at or above which a notification will be generated
|
2. Adding a notification listener for the MXBean to listen for the notification |
Comparison of the memory use by this memory pool with the value
of this threshold
is done periodically at a configurable time interval using
the interval that can be changed by calling
setIntervalToWaitBetweenUseThresholdChecks(long)
. Currently,
only the Java Heap supports the Use Threshold.
The getIntervalToWaitBetweenUseThresholdChecks()
returns the
current value that is the time interval between checks of the
threshold.
The current Use Threshold for this memory pool is obtained
by calling getUseThreshold()
.
Determine the number of times the threshold has been
exceeded by calling getUseThresholdExceededCount()
.
In the most recent interval specified by the time interval between
checks, find out whether the threshold has been
exceeded by calling isAfterCollectionUseThresholdExceeded()
.
To determine whether this memory pool supports the Memory Use
Threshold call isUseThresholdSupported()
.
Renotifications
setIntervalToWaitBeforeRenotifyWhenThresholdContinuouslyExceeded(long)
sets the minimum interval to wait before a renotification when the threshold
is continuously exceeded. The first notification is sent when the conditions
are checked and the threshold has been crossed. If, as time continues, the threshold
remains continuously exceeded, rather than flooding the system with notifications, no
additional notifications are sent.
Call
getIntervalToWaitBeforeRenotifyWhenThresholdContinuouslyExceeded()
to determine
the current value.
Notifications are easy to set up using the MemoryPoolMXBeans. Here is an
example that sets up a listener for notifications for the Java Heap and the
Old Generation memory pools. All of the notifications supported for
memory pools are threshold exceeded notifications.
Extracting information from the javax.management.Notification
object
that is delivered with the
memory pool notification is also in the example code.
Build the client program using:
$JAVA_HOME/javac -cp $JAVA_HOME/etc/extensions/mxbeans/agents/ZingJMM.jar ClientMemoryPoolNotification.java
import javax.management.JMX; import javax.management.JMX; import javax.management.MBeanServerConnection; import javax.management.Notification; import javax.management.NotificationListener; import javax.management.ObjectName; import javax.management.openmbean.CompositeData; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; import com.azul.zing.management.MemoryPoolMXBean; import com.azul.zing.management.MemoryPoolNotificationInfo; import com.azul.zing.management.MemoryPoolSizeType; import com.azul.zing.management.MemoryUsage; public class ClientMemoryPoolNotification { // Class to handle notifications public static class ClientListener implements NotificationListener { @Override public void handleNotification(Notification notification, Object handback) { if (notification.getType().equals(MemoryPoolNotificationInfo.MEMORY_USE_THRESHOLD_EXCEEDED) || notification.getType().equals(MemoryPoolNotificationInfo.MEMORY_USE_AFTER_COLLECTION_THRESHOLD_EXCEEDED) || notification.getType().equals(MemoryPoolNotificationInfo.MEMORY_LIVE_SET_SIZE_THRESHOLD_EXCEEDED)) { // Get the information associated with this notification long sequenceNumber = notification.getSequenceNumber(); long timeStamp = notification.getTimeStamp(); String type = notification.getType(); // Access NotificationInfo attributes MemoryPoolNotificationInfo info = MemoryPoolNotificationInfo.from((CompositeData) notification.getUserData()); String poolName = info.getPoolName(); String notificationReason = info.getNotificationReason(); long count = info.getCount(); // Access the MemoryUsage details MemoryUsage memoryUsage = info.getMemoryUsage(); double elapsedTime = memoryUsage.getElapsedTimeSinceJVMStartSec(); MemoryPoolSizeType mpst = memoryUsage.getMemoryPoolSizeType(); long initialReserved = memoryUsage.getInitialReserved(); long size = memoryUsage.getSize(); long used = memoryUsage.getUsed(); System.out.println("sequenceNumber: " + sequenceNumber + " timeStamp: " + timeStamp + " type: " + type + " poolName: " + poolName + " notificationReason: " + notificationReason + " count: " + count + " elapsedTime: " + elapsedTime + " memoryPoolSizeType: " + mpst + " initialReserved: " + initialReserved + " size: " + size + " used: " + used); // Your code ... } } } public static void main(String[] args) throws Exception { String ipAddr = args[0]; // IP address of the machine where the server is running String port = args[1]; // Port specified when starting the server using: // -Dcom.sun.management.jmxremote \ // -Dcom.sun.management.jmxremote.port=${listeningOnPort} \ // -Dcom.sun.management.jmxremote.authenticate=false \ // -Dcom.sun.management.jmxremote.ssl=false \ // Create an RMI connector client and connect to the RMI connector server // Protocol: // service:jmx:protocol:sap // //[host[:port]][url-path] // new JMXServiceURL("service:jmx:rmi: ///jndi/rmi://:9999/jmxrmi"); JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"+ ipAddr + ":" + port + "/jmxrmi"); JMXConnector jmxc = JMXConnectorFactory.connect(url, null); // Greate an MBeanServerConnection MBeanServerConnection mbsc = jmxc.getMBeanServerConnection(); // Set up to montitor the notifications generated by the MemoryPool MXBeans // Construct the ObjectName for the MemoryPool ObjectName mbeanNameMemoryPoolJavaHeap = new ObjectName("com.azul.zing:type=MemoryPool,name=Java Heap"); // Create a proxy for the MXBean instead of going through the MBean server connection MemoryPoolMXBean memoryPoolMXBeanProxyJavaHeap = JMX.newMXBeanProxy(mbsc, mbeanNameMemoryPoolJavaHeap, MemoryPoolMXBean.class, true); // Find out the amount of memory initially reserved for the Java Heap long Xmx = memoryPoolMXBeanProxyJavaHeap.getInitialReserved(); System.out.println("Xmx: " + Xmx); // Set a threshold value to generate a notification when the maximum Java // Heap occupied after collection exceeds that threshold; do the same for // the use if (memoryPoolMXBeanProxyJavaHeap.isAfterCollectionUseThresholdSupported()) { memoryPoolMXBeanProxyJavaHeap.setAfterCollectionUseThreshold((long)(Xmx * 0.9F)); } if (memoryPoolMXBeanProxyJavaHeap.isUseThresholdSupported()) { memoryPoolMXBeanProxyJavaHeap.setUseThreshold(Xmx); } // Construct the ObjectName for the Old Generation MemoryPool ObjectName mbeanNameMemoryPoolOldGen = new ObjectName("com.azul.zing:type=MemoryPool,name=GenPauseless Old Gen"); // Create a proxy for the MXBean instead of going through the MBean server connection MemoryPoolMXBean memoryPoolMXBeanProxyOldGen = JMX.newMXBeanProxy(mbsc, mbeanNameMemoryPoolOldGen, MemoryPoolMXBean.class, true); // Set a threshold value to generate a notification when the maximum Old // Generation occupied after collection exceeds that threshold; do the same for // the live set if (memoryPoolMXBeanProxyOldGen.isAfterCollectionUseThresholdSupported()) { memoryPoolMXBeanProxyOldGen.setAfterCollectionUseThreshold((long)(Xmx * 0.9F)); } if (memoryPoolMXBeanProxyOldGen.isLiveSetSizeThresholdSupported()) { memoryPoolMXBeanProxyOldGen.setLiveSetSizeThreshold((long)(Xmx * 0.8F)); } // Create the notification listeners ClientListener memoryPoolListenerJavaHeap = new ClientListener(); ClientListener memoryPoolListenerOldGen = new ClientListener(); // Add notification listeners for the MXBeans mbsc.addNotificationListener(mbeanNameMemoryPoolJavaHeap, memoryPoolListenerJavaHeap, null, null); mbsc.addNotificationListener(mbeanNameMemoryPoolOldGen, memoryPoolListenerOldGen, null, null); nap(20000000); } private static void nap(int millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { e.printStackTrace(); } } }
Pool name, parent and child pool names, memory manager names
isValid()
getName()
getParentPool()
getChildPools()
getMemoryManagerNames()
Is this pool using the process’s Java Heap or non-Java Heap or using System memory
getType()
returns a MemoryType
object
Is the MemoryPoolSizeType
for this pool FIXED
, ELASTIC
or UNINITIALIZED
getMemoryPoolSizeType()
returns a MemoryPoolSizeType
enum value
Current use, size and the intial reserved for this pool
getCurrentUse()
getCurrentSize()
getInitialReserved()
Current and peak memory usage
getCurrentMemoryUsage()
returns a MemoryUsage
object
getPeakUsage()
returns a MemoryUsage
object
resetPeakUsage()
getTimeOfLastResetPeakUsageSec()
Pool usage at start and end of collection
getStartOfCollectionUsage()
returns a MemoryUsage
object
getEndOfCollectionUsage()
returns a MemoryUsage
object
Peak memory usage at the end of collection and reset
getPeakEndOfCollectionUsage()
returns a MemoryUsage
object
resetPeakEndOfCollectionUsage()
getTimeOfLastResetPeakEndOfCollectionUsageSec()
Thresholds and notifications
After Collection Use Threshold
setAfterCollectionUseThreshold(long)
getAfterCollectionUseThreshold()
getAfterCollectionUseThresholdExceededCount()
isAfterCollectionUseThresholdExceeded()
isAfterCollectionUseThresholdSupported()
Live Set Size Threshold
setLiveSetSizeThreshold(long)
getLiveSetSizeThreshold()
getLiveSetSizeThresholdExceededCount()
isLiveSetSizeThresholdExceeded()
isLiveSetSizeThresholdSupported()
Use Threshold
setUseThreshold(long)
getUseThreshold()
getUseThresholdExceededCount()
isUseThresholdExceeded()
isUseThresholdSupported()
setIntervalToWaitBetweenUseThresholdChecks(long)
getIntervalToWaitBetweenUseThresholdChecks()
Interval to wait before sending another notification when a threshold is constantly exceeded
setIntervalToWaitBeforeRenotifyWhenThresholdContinuouslyExceeded(long)
getIntervalToWaitBeforeRenotifyWhenThresholdContinuouslyExceeded()
Modifier and Type | Method and Description |
---|---|
long |
getAfterCollectionUseThreshold()
The after collection use threshold (in bytes) of this pool; the default is
zero.
|
long |
getAfterCollectionUseThresholdExceededCount()
The number of times the after collection use threshold has been reached or
exceeded.
|
java.lang.String[] |
getChildPools()
The name of the child pools of this memory pool; returns null if the
memory pool contains no child memory pools.
|
MemoryUsage |
getCurrentMemoryUsage()
Approximate current detailed
MemoryUsage of this pool. |
long |
getCurrentSize()
Approximate current memory size of this pool.
|
long |
getCurrentUse()
Approximate current memory use of this pool.
|
MemoryUsage |
getEndOfCollectionUsage()
The memory usage at end of the JVM’s most recent attempt to
recycle unused objects.
|
long |
getInitialReserved()
Amount of memory intially reserved for this memory pool when it was intialized.
|
long |
getIntervalToWaitBeforeRenotifyWhenThresholdContinuouslyExceeded()
The minimum interval to wait before sending a renotification when the threshold is
continuously exceeded.
|
long |
getIntervalToWaitBetweenUseThresholdChecks()
The minimum interval to wait between checks to see whether the memory pool’s use
threshold has been exceeded.
|
long |
getLiveSetSizeThreshold()
The live set size threshold (in bytes) of this pool.
|
long |
getLiveSetSizeThresholdExceededCount()
The number of times the live set size threshold has been met or exceeded.
|
java.lang.String[] |
getMemoryManagerNames()
The names of the memory managers that manage this pool; there will be at
least one memory manager for each pool.
|
MemoryPoolSizeType |
getMemoryPoolSizeType()
Memory pool size type of this pool; answering the question whether this
memory pool size is
MemoryPoolSizeType FIXED ,
ELASTIC or UNINITIALIZED . |
java.lang.String |
getName()
Name of this memory pool.
|
java.lang.String |
getParentPool()
The name of the parent memory pool; returns an empty string if
the memory pool is not contained in a memory pool.
|
MemoryUsage |
getPeakEndOfCollectionUsage()
Returns the highest memory usage measured at the end of a garbage
collection.
|
MemoryUsage |
getPeakUsage()
Peak
MemoryUsage of this pool since JVM startup or since the last
reset of the peak. |
MemoryUsage |
getStartOfCollectionUsage()
The memory usage at start of the JVM’s most recent attempt to
recycle unused objects.
|
double |
getTimeOfLastResetPeakEndOfCollectionUsageSec()
Returns the time in seconds from the start of the program until
the last reset of the peak end of collection memory usage.
|
double |
getTimeOfLastResetPeakUsageSec()
Returns the time in seconds from the start of the program until
the last reset of the peak memory usage.
|
MemoryType |
getType()
Memory type of this pool; answering the question whether the
memory in use by the pool is from the process’s Java Heap
or non-Java Heap or from System memory.
|
long |
getUseThreshold()
The current use threshold (in bytes) of this pool.
|
long |
getUseThresholdExceededCount()
The number of times the use threshold has been met or exceeded.
|
java.lang.String |
getVersion()
Version of the MemoryPoolMXBean application programming interface.
|
boolean |
isAfterCollectionUseThresholdExceeded()
Indicates whether or not the after collection use threshold has been met or
exceeded after the most recent collection.
|
boolean |
isAfterCollectionUseThresholdSupported()
Indicates whether or not this pool supports after collection use threshold
monitoring.
|
boolean |
isLiveSetSizeThresholdExceeded()
Indicates whether or not the live set size threshold is currently met or
exceeded.
|
boolean |
isLiveSetSizeThresholdSupported()
Indicates whether or not live set size threshold monitoring is supported.
|
boolean |
isUseThresholdExceeded()
Indicates whether or not the use threshold is currently met or
exceeded.
|
boolean |
isUseThresholdSupported()
Indicates whether or not use threshold monitoring is supported.
|
boolean |
isValid()
Indicates whether or not the pool is currently valid.
|
double |
resetPeakEndOfCollectionUsage()
Resets the highest memory usage measured at the end of a garbage
collection to the value of the memory usage at the end of the most
recently preceding completed garbage collection.
|
double |
resetPeakUsage()
Resets the peak memory usage to the value at the end of the last previously
completed garbage collection.
|
boolean |
setAfterCollectionUseThreshold(long threshold)
Sets the after collection use threshold (in bytes) for this memory pool.
|
boolean |
setIntervalToWaitBeforeRenotifyWhenThresholdContinuouslyExceeded(long secondsToWaitBeforeRenotify)
Sets the minimum interval to wait before a renotification when the threshold
is continuously exceeded.
|
boolean |
setIntervalToWaitBetweenUseThresholdChecks(long secondsBetweenUseThresholdChecks)
Sets the minimum interval to wait between checks to see whether the memory pool’s use
threshold has been exceeded.
|
boolean |
setLiveSetSizeThreshold(long threshold)
Sets the live set size threshold (in bytes) for this memory pool.
|
boolean |
setUseThreshold(long threshold)
Sets the use threshold (in bytes) for this memory pool.
|
long getAfterCollectionUseThreshold()
The after collection use threshold (in bytes) of this pool; the default is zero.
java.lang.UnsupportedOperationException
- if this is not supported.isAfterCollectionUseThresholdSupported()
long getAfterCollectionUseThresholdExceededCount()
The number of times the after collection use threshold has been reached or exceeded.
java.lang.UnsupportedOperationException
- if this is not supported.isAfterCollectionUseThresholdSupported()
java.lang.String[] getChildPools()
The name of the child pools of this memory pool; returns null if the memory pool contains no child memory pools.
String[]
of the names of the child memory pools.MemoryUsage getCurrentMemoryUsage()
Approximate current detailed MemoryUsage
of this pool.
The returned MemoryUsage
object includes the initial reserved, size
and use of the memory pool. It will return null
if the pool
is invalid.
MemoryUsage
instance representing the current detailed
usage or null
if the pool is invalid.long getCurrentSize()
Approximate current memory size of this pool.
long
representing the current memory size.long getCurrentUse()
Approximate current memory use of this pool.
long
representing the current memory use.MemoryUsage getEndOfCollectionUsage()
The memory usage at end of the JVM’s most recent attempt to
recycle unused objects. If this feature is not supported, then
null
will be returned.
MemoryUsage
instance representing the memory usage
at the end of the most recent attempt to recycle unused objects;
null
may be returned to indicate this method is not
supported.long getInitialReserved()
Amount of memory intially reserved for this memory pool when it was intialized.
long
representing the number of initially reserved byteslong getIntervalToWaitBeforeRenotifyWhenThresholdContinuouslyExceeded()
The minimum interval to wait before sending a renotification when the threshold is continuously exceeded. The first notification is sent when the conditions are checked and the threshold has been crossed. If, as time continues, the threshold remains continuously exceeded, rather than flooding the system with notifications, no additional notifications are sent. This value represents the minimum number of seconds to wait before renotifying when that threshold is continuously exceeded. If the returned value is zero, no renotifications are generated.
java.lang.UnsupportedOperationException
- if this is not supported.setIntervalToWaitBeforeRenotifyWhenThresholdContinuouslyExceeded()
for an explanation of the time interval to wait before renotification
when the threshold is continuously exceeded.
long getIntervalToWaitBetweenUseThresholdChecks()
The minimum interval to wait between checks to see whether the memory pool’s use
threshold has been exceeded. When set to 0, the use threshold check
is turned off and no memory pool use tracking will be done for this memory pool.
The default value is 300 seconds when setUseThreshold(long)
is first set.
java.lang.UnsupportedOperationException
- if this is not supported.setIntervalToWaitBetweenUseThresholdChecks()
for an explanation of the time interval to wait between memory pool use checks.
long getLiveSetSizeThreshold()
The live set size threshold (in bytes) of this pool.
java.lang.UnsupportedOperationException
- if this is not supported.isLiveSetSizeThresholdSupported()
long getLiveSetSizeThresholdExceededCount()
The number of times the live set size threshold has been met or exceeded.
java.lang.UnsupportedOperationException
- if this is not supported.isLiveSetSizeThresholdSupported()
java.lang.String[] getMemoryManagerNames()
The names of the memory managers that manage this pool; there will be at least one memory manager for each pool.
String[]
of memory manager names.MemoryPoolSizeType getMemoryPoolSizeType()
Memory pool size type of this pool; answering the question whether this
memory pool size is MemoryPoolSizeType
FIXED
,
ELASTIC
or UNINITIALIZED
.
MemoryPoolSizeType
objectjava.lang.String getName()
Name of this memory pool.
java.lang.String getParentPool()
The name of the parent memory pool; returns an empty string if the memory pool is not contained in a memory pool.
MemoryUsage getPeakEndOfCollectionUsage()
Returns the highest memory usage measured at the end of a garbage
collection.
The highest memory usage of this pool at the end of the last previously completed
garbage collections since either the start of the JVM or the last preceding
call to resetPeakEndOfCollectionUsage()
. This method will
return a MemoryUsage
with a type field with the value "UNINITIALIZED"
if the pool is invalid.
MemoryUsage
instance representing the peak usage at the
end of a garbage collection and a type field of "UNINITIALIZED"
if the pool is invalid.MemoryUsage getPeakUsage()
Peak MemoryUsage
of this pool since JVM startup or since the last
reset of the peak. The MemoryUsage
object will included the
use of the pool and the time of the peak use.
MemoryUsage
instance representing the peak
usage or null
if the pool is invalid.resetPeakUsage()
MemoryUsage getStartOfCollectionUsage()
The memory usage at start of the JVM’s most recent attempt to
recycle unused objects. If this feature is not supported, then
null
will be returned.
MemoryUsage
instance representing the memory usage
at the start of the most recent attempt to recycle unused objects;
null
may be returned to indicate this method is not
supported.double getTimeOfLastResetPeakEndOfCollectionUsageSec()
Returns the time in seconds from the start of the program until the last reset of the peak end of collection memory usage.
double getTimeOfLastResetPeakUsageSec()
Returns the time in seconds from the start of the program until the last reset of the peak memory usage.
MemoryType getType()
Memory type of this pool; answering the question whether the memory in use by the pool is from the process’s Java Heap or non-Java Heap or from System memory.
MemoryType
objectlong getUseThreshold()
The current use threshold (in bytes) of this pool.
java.lang.UnsupportedOperationException
- if this is not supported.isUseThresholdSupported()
long getUseThresholdExceededCount()
The number of times the use threshold has been met or exceeded.
java.lang.UnsupportedOperationException
- if this is not supported.isUseThresholdSupported()
java.lang.String getVersion()
Version of the MemoryPoolMXBean application programming interface. The format for the version is majorVersion.minorVersion.microVersion.
boolean isAfterCollectionUseThresholdExceeded()
Indicates whether or not the after collection use threshold has been met or exceeded after the most recent collection.
true
if the after collection use threshold was met or
exceeded, otherwise false
.java.lang.UnsupportedOperationException
- if this is not supported.isAfterCollectionUseThresholdSupported()
boolean isAfterCollectionUseThresholdSupported()
Indicates whether or not this pool supports after collection use threshold monitoring.
true
if supported, false
otherwise.boolean isLiveSetSizeThresholdExceeded()
Indicates whether or not the live set size threshold is currently met or exceeded.
true
if the live set size threshold is met or exceeded,
otherwise false
.java.lang.UnsupportedOperationException
- if this is not supported.isLiveSetSizeThresholdSupported()
boolean isLiveSetSizeThresholdSupported()
Indicates whether or not live set size threshold monitoring is supported.
true
if supported, otherwise false
.boolean isUseThresholdExceeded()
Indicates whether or not the use threshold is currently met or exceeded.
true
if the use threshold is met or exceeded,
otherwise false
.java.lang.UnsupportedOperationException
- if this is not supported.isUseThresholdSupported()
boolean isUseThresholdSupported()
Indicates whether or not use threshold monitoring is supported.
true
if supported, otherwise false
.boolean isValid()
Indicates whether or not the pool is currently valid. A memory pool may be removed by a JVM and become invalid.
true
if the pool is valid, false
otherwise.double resetPeakEndOfCollectionUsage()
Resets the highest memory usage measured at the end of a garbage collection to the value of the memory usage at the end of the most recently preceding completed garbage collection.
java.lang.SecurityException
- if caller does not have
ManagementPermission("control")
.double resetPeakUsage()
Resets the peak memory usage to the value at the end of the last previously completed garbage collection.
java.lang.SecurityException
- if caller does not have
ManagementPermission("control")
.boolean setAfterCollectionUseThreshold(long threshold)
Sets the after collection use threshold (in bytes) for this memory pool. The default value is zero. If the value is zero then it will not be possible to subscribe to notifications based on crossing this threshold.
threshold
- The new, non-negative threshold.true
when successful execution,
otherwise false
.java.lang.IllegalArgumentException
- if the new threshold
is either negative
or greater than the maximum memory allowed.java.lang.UnsupportedOperationException
- if this is not supported.java.lang.SecurityException
- if caller does not have
ManagementPermission("control")
.boolean setIntervalToWaitBeforeRenotifyWhenThresholdContinuouslyExceeded(long secondsToWaitBeforeRenotify)
Sets the minimum interval to wait before a renotification when the threshold
is continuously exceeded. The first notification is sent when the conditions
are checked and the threshold has been crossed. If, as time continues, the threshold
remains continuously exceeded, rather than flooding the system with notifications, no
additional notifications are sent.
However, the
setIntervalToWaitBeforeRenotifyWhenThresholdContinuouslyExceeded
can
be set to a time interval that, measured from the time of the previous notification, would cause
a renotification to be sent when the threshold is continuously exceeded. If the
renotification is sent then the timer starts again at that time to determine
when the next time interval will be exceeded. Use of this feature does not guarantee that
renotifications will occur at the interval specified because the check for the
resource’s exceeding of the threshold may only occur at an interval longer than
the value of the parameter supplied.
The default value is 0 and, when set to that value, means that no renotifications
will be generated for this memory pool.
secondsToWaitBeforeRenotify
- The minimum interval to wait in seconds before a renotification.true
when successful execution,
otherwise false
.java.lang.IllegalArgumentException
- if the new secondsToWaitBeforeRenotify
is either negative or greater than the maximum allowed.java.lang.UnsupportedOperationException
- if this is not supported.java.lang.SecurityException
- if caller does not have
ManagementPermission("control")
.boolean setIntervalToWaitBetweenUseThresholdChecks(long secondsBetweenUseThresholdChecks)
Sets the minimum interval to wait between checks to see whether the memory pool’s use
threshold has been exceeded. When set to 0, the use threshold check
is turned off and no memory pool use tracking will be done for this memory pool.
The default value is 300 seconds when setUseThreshold(long)
is first set.
If setUseThreshold
is used to turn off memory pool use threshold tracking for this memory pool
and subsequently
setUseThreshold
is used to again turn memory pool use threshold tracking on
then the interval value will be either that from the period of time when memory pool use
threshold tracking was last on or the interval value specified in a subsequent call to this
method.
secondsBetweenUseThresholdChecks
- The minimum interval to wait in seconds before
rechecking whether the memory pool’s use exceeds the threshold.true
when successful execution,
otherwise false
.java.lang.IllegalArgumentException
- if the new setIntervalToWaitBetweenUseThresholdChecks
is either negative or greater than the maximum allowed.java.lang.UnsupportedOperationException
- if this is not supported.java.lang.SecurityException
- if caller does not have
ManagementPermission("control")
.boolean setLiveSetSizeThreshold(long threshold)
Sets the live set size threshold (in bytes) for this memory pool. The default value is zero. If the value is zero then it will not be possible to subscribe to notifications based on crossing this threshold.
threshold
- The new, non-negative threshold.true
when successful execution,
otherwise false
.java.lang.IllegalArgumentException
- if the new threshold
is either negative
or greater than the maximum memory allowed.java.lang.UnsupportedOperationException
- if this is not supported.java.lang.SecurityException
- if caller does not have
ManagementPermission("control")
.boolean setUseThreshold(long threshold)
Sets the use threshold (in bytes) for this memory pool. The default value is zero. If the value is zero then it will not be possible to subscribe to notifications based on crossing this threshold.
threshold
- The new, non-negative threshold.true
when successful execution,
otherwise false
.java.lang.IllegalArgumentException
- if the new threshold
is either negative
or greater than the maximum memory allowed.java.lang.UnsupportedOperationException
- if this is not supported.java.lang.SecurityException
- if caller does not have
ManagementPermission("control")
. Submit a bug or feature request
Copyright © 2015-2017, Azul Systems, Inc. All rights reserved.
Azul Systems and Zing are registered trademarks of Azul Systems, Inc.