java.lang.management
public class MemoryNotificationInfo extends Object
Represents the content of a notification emitted by the {@link MemoryMXBean}. Such notifications are emitted when one of the memory pools exceeds its usage or collection usage threshold. This object contains the following information, representing the state of the pool at the time of the notification:
Two types of notification are emitted by the {@link MemoryMXBean}: one for exceeding the usage threshold and one for exceeding the collection usage threshold. The value returned by {@link #getCount()} is dependent on this type; if the threshold exceeded is the usage threshold, then the usage threshold count is returned. If, instead, the collection usage threshold is exceeded, then the collection usage threshold count is returned.
This data is held in the user data part of the notification (returned by {@link javax.management.Notification#getUserData()}) encapsulated in a {@link javax.management.openmbean.CompositeData} object. The {@link #from(javax.management.openmbean.CompositeData)} method may be used to unwrap the value and obtain an instance of this class.
Since: 1.5
Field Summary | |
---|---|
static String | MEMORY_COLLECTION_THRESHOLD_EXCEEDED
The type of notification emitted when the collection usage threshold
is exceeded, following a garbage collection cycle. |
static String | MEMORY_THRESHOLD_EXCEEDED
The type of notification emitted when the usage threshold is exceeded.
|
Constructor Summary | |
---|---|
MemoryNotificationInfo(String poolName, MemoryUsage usage, long count)
Constructs a new {@link MemoryNotificationInfo} object using the
specified pool name, usage level and threshold crossing count.
|
Method Summary | |
---|---|
static MemoryNotificationInfo | from(CompositeData data) Returns a {@link MemoryNotificationInfo} instance using the values given in the supplied {@link javax.management.openmbean.CompositeData} object. |
long | getCount()
Returns the number of times the memory pool has crossed the usage
threshold, as of the time of notification. |
String | getPoolName()
Returns the name of the pool which has crossed a threshold.
|
MemoryUsage | getUsage()
Returns the usage levels at the time of notification.
|
java.management.memory.collection.threshold.exceeded
.java.management.memory.threshold.exceeded
.Parameters: poolName the name of the pool which has exceeded a threshold. usage the usage level of the pool at the time of notification. count the number of times the threshold has been crossed.
Returns a {@link MemoryNotificationInfo} instance using the values given in the supplied {@link javax.management.openmbean.CompositeData} object. The composite data instance should contain the following attributes with the specified types:
Name | Type |
poolName | java.lang.String |
usage | javax.management.openmbean.CompositeData |
count | java.lang.Long |
The usage level is further described as:
Name | Type |
init | java.lang.Long |
used | java.lang.Long |
committed | java.lang.Long |
max | java.lang.Long |
Parameters: data the composite data structure to take values from.
Returns: a new instance containing the values from the
composite data structure, or null
if the data structure was also null
.
Throws: IllegalArgumentException if the composite data structure does not match the structure outlined above.
Returns: the number of times the appropriate threshold has been crossed.
Returns: the name of the pool.
Returns: the usage levels.