java.lang.Object java.util.EventObject javax.management.Notification java.lang.management.MemoryNotification
A memory notification emitted by MemoryMBean
indicating that the Java virtual machine detects that the memory
usage of a memory pool is crossing a threshold value.
The types of notifications emitted by MemoryMBean are:
usage threshold exceeded notification
.
collection usage threshold exceeded notification
.
A memory notification contains the following information of a memory pool about the detected condition:
usage threshold
count
. For collection threshold notifications,
this count will be the
collection usage threshold count
.
Field Summary | |
---|---|
static String |
MEMORY_COLLECTION_THRESHOLD_EXCEEDED
Notification type denoting that the memory usage of a memory pool is greater than or equal to its collection usage threshold after the Java virtual machine has expended effort in recycling unused objects in that memory pool. |
static String |
MEMORY_THRESHOLD_EXCEEDED
Notification type denoting that the memory usage of a memory pool has reached or exceeded its usage threshold value. |
Constructor Summary | |
---|---|
MemoryNotification(String type,
String poolName,
MemoryUsage usage,
long count,
long sequenceNumber,
long timeStamp,
String msg)
Constructs a MemoryNotification object with the ObjectName of
MemoryMBean as the source. |
Method Summary | |
---|---|
long |
getCount()
Returns the number of times that the memory usage has crossed a threshold when the notification was constructed. |
String |
getPoolName()
Returns the name of the memory pool that triggers this notification. |
MemoryUsage |
getUsage()
Returns the memory usage of the memory pool when this notification was constructed. |
Methods inherited from class javax.management.Notification |
---|
getMessage, getSequenceNumber, getTimeStamp, getType, getUserData, setSequenceNumber, setSource, setTimeStamp, setUserData, toString |
Methods inherited from class java.util.EventObject |
---|
getSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String MEMORY_THRESHOLD_EXCEEDED
MemoryMBean
.
Subsequent crossing of the usage threshold value does not cause
further notification until the memory usage has returned
to become less than the usage threshold value.
The value of this notification type is
java.management.memory.threshold.exceeded.
public static final String MEMORY_COLLECTION_THRESHOLD_EXCEEDED
MemoryMBean
.
The value of this notification type is
java.management.memory.collection.threshold.exceeded.
Constructor Detail |
---|
public MemoryNotification(String type, String poolName, MemoryUsage usage, long count, long sequenceNumber, long timeStamp, String msg)
ObjectName
of
MemoryMBean
as the source.
type
- The notification type.poolName
- The name of the memory pool which triggers this notification.usage
- Memory usage of the memory pool.count
- The threshold crossing count.sequenceNumber
- The notification sequence number within
the source object.timeStamp
- The date at which the notification is being sent.msg
- A String containing the message of the notification.
IllegalArgumentException
- if sequenceNumber
or timeStamp is negative.Method Detail |
---|
public String getPoolName()
public MemoryUsage getUsage()
public long getCount()
threshold
count
. For collection threshold notifications,
this count will be the
collection usage threshold count
.