public class MemoryNotificationInfo extends Object
MemoryMXBean
when a memory pool exceeds a
threshold value.
If the memory usage of a memory pool increases such that it reaches or
exceeds the memory usage threshold, a MEMORY_THRESHOLD_EXCEEDED
notification is sent.
If, upon the completion of a run of the garbage collector, a memory pool
exceeds its collection usage threshold, a
MEMORY_COLLECTION_THRESHOLD_EXCEEDED
notification is sent.
Modifier and Type | Field and Description |
---|---|
static String |
MEMORY_COLLECTION_THRESHOLD_EXCEEDED
Notification type that signifies a memory pool's memory usage has grown
to reach or exceed the collection usage threshold value set for it after
a run of the garbage collector.
|
static String |
MEMORY_THRESHOLD_EXCEEDED
Notification type that signifies a memory pool has grown such that it now
reaches or exceeds the usage threshold value set for it.
|
Constructor and Description |
---|
MemoryNotificationInfo(String poolName,
MemoryUsage usage,
long count)
Creates a new
MemoryNotificationInfo instance. |
Modifier and Type | Method and Description |
---|---|
static MemoryNotificationInfo |
from(CompositeData cd)
Receives a
CompositeData representing a
MemoryNotificationInfo object and attempts to return
the root MemoryNotificationInfo instance. |
long |
getCount()
Returns the number of times that the memory usage has crossed the
threshold relevant to the type of notification when the notification was
constructed.
|
String |
getPoolName()
Returns the name of the memory pool that the notification relates to.
|
MemoryUsage |
getUsage()
Returns an instance of
MemoryUsage that encapsulates the memory
usage of the memory pool that gave rise to this notification at the time
the notification was created. |
public static final String MEMORY_THRESHOLD_EXCEEDED
public static final String MEMORY_COLLECTION_THRESHOLD_EXCEEDED
public MemoryNotificationInfo(String poolName, MemoryUsage usage, long count)
MemoryNotificationInfo
instance.poolName
- the name of the memory pool that the notification relates to.usage
- the memory usage for the named poolcount
- the number of times that the memory usage of the memory pool
has met or exceeded the relevant threshold. For notifications
of the MEMORY_THRESHOLD_EXCEEDED
type, this will a
count of the number of times the memory usage threshold has
been met or exceeded. For
MEMORY_COLLECTION_THRESHOLD_EXCEEDED
notifications,
this will be the number of times that the collection usage
threshold was passed.NullPointerException
- when poolName or usage is nullpublic long getCount()
MEMORY_THRESHOLD_EXCEEDED
type, this will a count of the number of times the memory usage threshold
has been met or exceeded. For
MEMORY_COLLECTION_THRESHOLD_EXCEEDED
notifications, this will be
the number of times that the collection usage threshold was passed.public String getPoolName()
public MemoryUsage getUsage()
MemoryUsage
that encapsulates the memory
usage of the memory pool that gave rise to this notification at the time
the notification was created. The MemoryUsage
may be
interrogated by the caller to find out the details of the memory usage.public static MemoryNotificationInfo from(CompositeData cd)
CompositeData
representing a
MemoryNotificationInfo
object and attempts to return
the root MemoryNotificationInfo
instance.cd
- a CompositeDate
that represents a
MemoryNotificationInfo
.cd
is non- null
, returns a new
instance of MemoryNotificationInfo
.
If cd
is null
, returns null
.IllegalArgumentException
- if argument cd
does not correspond to a
MemoryNotificationInfo
with the following
attributes:
poolName
(java.lang.String
)
usage
(
javax.management.openmbean.CompositeData
)
count
(
java.lang.Long
)
The usage
attribute must represent a MemoryUsage
instance which encapsulates the memory usage of a memory pool.
Eclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 1993, 2023 IBM Corp. and others.