1 *java.lang.management.MemoryNotificationInfo* *MemoryNotificationInfo* The infor
3 public class MemoryNotificationInfo
4 extends |java.lang.Object|
6 |java.lang.management.MemoryNotificationInfo_Description|
7 |java.lang.management.MemoryNotificationInfo_Fields|
8 |java.lang.management.MemoryNotificationInfo_Constructors|
9 |java.lang.management.MemoryNotificationInfo_Methods|
11 ================================================================================
13 *java.lang.management.MemoryNotificationInfo_Fields*
14 |java.lang.String_java.lang.management.MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED|
15 |java.lang.String_java.lang.management.MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED|
17 *java.lang.management.MemoryNotificationInfo_Constructors*
18 |java.lang.management.MemoryNotificationInfo(String,MemoryUsage,long)|Construct
20 *java.lang.management.MemoryNotificationInfo_Methods*
21 |java.lang.management.MemoryNotificationInfo.from(CompositeData)|Returns a Memo
22 |java.lang.management.MemoryNotificationInfo.getCount()|Returns the number of t
23 |java.lang.management.MemoryNotificationInfo.getPoolName()|Returns the name of
24 |java.lang.management.MemoryNotificationInfo.getUsage()|Returns the memory usag
26 *java.lang.management.MemoryNotificationInfo_Description*
28 The information about a memory notification.
30 A memory notification is emitted by (|java.lang.management.MemoryMXBean|) when
31 the Java virtual machine detects that the memory usage of a memory pool is
32 exceeding a threshold value. The notification emitted will contain the memory
33 notification information about the detected condition:
35 The name of the memory pool. The memory usage of the memory pool when the
36 notification was constructed. The number of times that the memory usage has
37 crossed a threshold when the notification was constructed. For usage threshold
38 notifications, this count will be the usage threshold
39 count(|java.lang.management.MemoryPoolMXBean|) . For collection threshold
40 notifications, this count will be the collection usage threshold
41 count(|java.lang.management.MemoryPoolMXBean|) .
45 A CompositeData(|javax.management.openmbean.CompositeData|) representing the
46 MemoryNotificationInfo object is stored in the user
47 data(|javax.management.Notification|) of a
48 notification(|javax.management.Notification|) . The
49 from(|java.lang.management.MemoryNotificationInfo|) method is provided to
50 convert from a CompositeData to a MemoryNotificationInfo object. For example:
56 // receive the notification emitted by MemoryMXBean and set to notif ...
58 String notifType = notif.getType(); if
59 (notifType.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED) ||
60 notifType.equals(MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED))
61 { // retrieve the memory notification information CompositeData cd =
62 (CompositeData) notif.getUserData(); MemoryNotificationInfo info =
63 MemoryNotificationInfo.from(cd); .... }
65 The types of notifications emitted by MemoryMXBean are:
67 A usage threshold exceeded
68 notification(|java.lang.management.MemoryNotificationInfo|) . This notification
69 will be emitted when the memory usage of a memory pool is increased and has
70 reached or exceeded its usage threshold value. Subsequent crossing of the usage
71 threshold value does not cause further notification until the memory usage has
72 returned to become less than the usage threshold value.
74 A collection usage threshold exceeded
75 notification(|java.lang.management.MemoryNotificationInfo|) . This notification
76 will be emitted when the memory usage of a memory pool is greater than or equal
79 collection usage threshold after the Java virtual machine has expended effort
80 in recycling unused objects in that memory pool.
83 *java.lang.String_java.lang.management.MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED*
85 The information about a memory notification.
87 A memory notification is emitted by (|java.lang.management.MemoryMXBean|) when
88 the Java virtual machine detects that the memory usage of a memory pool is
89 exceeding a threshold value. The notification emitted will contain the memory
90 notification information about the detected condition:
92 The name of the memory pool. The memory usage of the memory pool when the
93 notification was constructed. The number of times that the memory usage has
94 crossed a threshold when the notification was constructed. For usage threshold
95 notifications, this count will be the usage threshold
96 count(|java.lang.management.MemoryPoolMXBean|) . For collection threshold
97 notifications, this count will be the collection usage threshold
98 count(|java.lang.management.MemoryPoolMXBean|) .
102 A CompositeData(|javax.management.openmbean.CompositeData|) representing the
103 MemoryNotificationInfo object is stored in the user
104 data(|javax.management.Notification|) of a
105 notification(|javax.management.Notification|) . The
106 from(|java.lang.management.MemoryNotificationInfo|) method is provided to
107 convert from a CompositeData to a MemoryNotificationInfo object. For example:
113 // receive the notification emitted by MemoryMXBean and set to notif ...
115 String notifType = notif.getType(); if
116 (notifType.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED) ||
117 notifType.equals(MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED))
118 { // retrieve the memory notification information CompositeData cd =
119 (CompositeData) notif.getUserData(); MemoryNotificationInfo info =
120 MemoryNotificationInfo.from(cd); .... }
122 The types of notifications emitted by MemoryMXBean are:
124 A usage threshold exceeded
125 notification(|java.lang.management.MemoryNotificationInfo|) . This notification
126 will be emitted when the memory usage of a memory pool is increased and has
127 reached or exceeded its usage threshold value. Subsequent crossing of the usage
128 threshold value does not cause further notification until the memory usage has
129 returned to become less than the usage threshold value.
131 A collection usage threshold exceeded
132 notification(|java.lang.management.MemoryNotificationInfo|) . This notification
133 will be emitted when the memory usage of a memory pool is greater than or equal
136 collection usage threshold after the Java virtual machine has expended effort
137 in recycling unused objects in that memory pool.
140 *java.lang.String_java.lang.management.MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED*
142 The information about a memory notification.
144 A memory notification is emitted by (|java.lang.management.MemoryMXBean|) when
145 the Java virtual machine detects that the memory usage of a memory pool is
146 exceeding a threshold value. The notification emitted will contain the memory
147 notification information about the detected condition:
149 The name of the memory pool. The memory usage of the memory pool when the
150 notification was constructed. The number of times that the memory usage has
151 crossed a threshold when the notification was constructed. For usage threshold
152 notifications, this count will be the usage threshold
153 count(|java.lang.management.MemoryPoolMXBean|) . For collection threshold
154 notifications, this count will be the collection usage threshold
155 count(|java.lang.management.MemoryPoolMXBean|) .
159 A CompositeData(|javax.management.openmbean.CompositeData|) representing the
160 MemoryNotificationInfo object is stored in the user
161 data(|javax.management.Notification|) of a
162 notification(|javax.management.Notification|) . The
163 from(|java.lang.management.MemoryNotificationInfo|) method is provided to
164 convert from a CompositeData to a MemoryNotificationInfo object. For example:
170 // receive the notification emitted by MemoryMXBean and set to notif ...
172 String notifType = notif.getType(); if
173 (notifType.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED) ||
174 notifType.equals(MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED))
175 { // retrieve the memory notification information CompositeData cd =
176 (CompositeData) notif.getUserData(); MemoryNotificationInfo info =
177 MemoryNotificationInfo.from(cd); .... }
179 The types of notifications emitted by MemoryMXBean are:
181 A usage threshold exceeded
182 notification(|java.lang.management.MemoryNotificationInfo|) . This notification
183 will be emitted when the memory usage of a memory pool is increased and has
184 reached or exceeded its usage threshold value. Subsequent crossing of the usage
185 threshold value does not cause further notification until the memory usage has
186 returned to become less than the usage threshold value.
188 A collection usage threshold exceeded
189 notification(|java.lang.management.MemoryNotificationInfo|) . This notification
190 will be emitted when the memory usage of a memory pool is greater than or equal
193 collection usage threshold after the Java virtual machine has expended effort
194 in recycling unused objects in that memory pool.
198 *java.lang.management.MemoryNotificationInfo(String,MemoryUsage,long)*
200 public MemoryNotificationInfo(
201 java.lang.String poolName,
202 java.lang.management.MemoryUsage usage,
205 Constructs a MemoryNotificationInfo object.
207 poolName - The name of the memory pool which triggers this notification.
208 usage - Memory usage of the memory pool.
209 count - The threshold crossing count.
211 *java.lang.management.MemoryNotificationInfo.from(CompositeData)*
213 public static |java.lang.management.MemoryNotificationInfo| from(javax.management.openmbean.CompositeData cd)
215 Returns a MemoryNotificationInfo object represented by the given CompositeData.
216 The given CompositeData must contain the following attributes:
222 poolName java.lang.String
224 usage javax.management.openmbean.CompositeData
230 cd - CompositeData representing a MemoryNotificationInfo
232 Returns: a MemoryNotificationInfo object represented by cd if cd is not null; null
234 *java.lang.management.MemoryNotificationInfo.getCount()*
236 public long getCount()
238 Returns the number of times that the memory usage has crossed a threshold when
239 the notification was constructed. For usage threshold notifications, this count
240 will be the threshold count(|java.lang.management.MemoryPoolMXBean|) . For
241 collection threshold notifications, this count will be the collection usage
242 threshold count(|java.lang.management.MemoryPoolMXBean|) .
245 Returns: the number of times that the memory usage has crossed a threshold when the
246 notification was constructed.
247 *java.lang.management.MemoryNotificationInfo.getPoolName()*
249 public |java.lang.String| getPoolName()
251 Returns the name of the memory pool that triggers this notification. The memory
252 pool usage has crossed a threshold.
255 Returns: the name of the memory pool that triggers this notification.
256 *java.lang.management.MemoryNotificationInfo.getUsage()*
258 public |java.lang.management.MemoryUsage| getUsage()
260 Returns the memory usage of the memory pool when this notification was
264 Returns: the memory usage of the memory pool when this notification was constructed.