1. /*
  2. * @(#)MemoryPoolMXBean.java 1.18 04/04/20
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.lang.management;
  8. /**
  9. * The management interface for a memory pool. A memory pool
  10. * represents the memory resource managed by the Java virtual machine
  11. * and is managed by one or more {@link MemoryManagerMXBean memory managers}.
  12. *
  13. * <p> A Java virtual machine has one or more instances of the
  14. * implementation class of this interface. An instance
  15. * implementing this interface is
  16. * an <a href="ManagementFactory.html#MXBean">MXBean</a>
  17. * that can be obtained by calling
  18. * the {@link ManagementFactory#getMemoryPoolMXBeans} method or
  19. * from the {@link ManagementFactory#getPlatformMBeanServer
  20. * platform <tt>MBeanServer</tt>} method.
  21. *
  22. * <p>The <tt>ObjectName</tt> for uniquely identifying the MXBean for
  23. * a memory pool within an <tt>MBeanServer</tt> is:
  24. * <blockquote>
  25. * {@link ManagementFactory#MEMORY_POOL_MXBEAN_DOMAIN_TYPE
  26. * <tt>java.lang:type=MemoryPool</tt>}<tt>,name=</tt><i>pool's name</i>
  27. * </blockquote>
  28. *
  29. * <h4>Memory Type</h4>
  30. * <p>The Java virtual machine has a heap for object allocation and also
  31. * maintains non-heap memory for the method area and the Java virtual
  32. * machine execution. The Java virtual machine can have one or more
  33. * memory pools. Each memory pool represents a memory area
  34. * of one of the following types:
  35. * <ul>
  36. * <li>{@link MemoryType#HEAP heap}</li>
  37. * <li>{@link MemoryType#NON_HEAP non-heap}</li>
  38. * </ul>
  39. *
  40. * <h4>Memory Usage Monitoring</h4>
  41. *
  42. * A memory pool has the following attributes:
  43. * <ul>
  44. * <li><a href="Usage">Memory usage</a></li>
  45. * <li><a href="PeakUsage">Peak memory usage</a></li>
  46. * <li><a href="UsageThreshold">Usage Threshold</a></li>
  47. * <li><a href="CollectionThreshold">Collection Usage Threshold</a>
  48. * (only supported by some <em>garbage-collected</em> memory pools)</li>
  49. * </ul>
  50. *
  51. * <h4><a name="Usage">1. Memory Usage</a></h4>
  52. *
  53. * The {@link #getUsage} method provides an estimate
  54. * of the current usage of a memory pool.
  55. * For a garbage-collected memory pool, the amount of used memory
  56. * includes the memory occupied by all objects in the pool
  57. * including both <em>reachable</em> and <em>unreachable</em> objects.
  58. *
  59. * <p>In general, this method is a lightweight operation for getting
  60. * an approximate memory usage. For some memory pools, for example,
  61. * when objects are not packed contiguously, this method may be
  62. * an expensive operation that requires some computation to determine
  63. * the current memory usage. An implementation should document when
  64. * this is the case.
  65. *
  66. * <h4><a name="PeakUsage">2. Peak Memory Usage</a></h4>
  67. *
  68. * The Java virtual machine maintains the peak memory usage of a memory
  69. * pool since the virtual machine was started or the peak was reset.
  70. * The peak memory usage is returned by the {@link #getPeakUsage} method
  71. * and reset by calling the {@link #resetPeakUsage} method.
  72. *
  73. * <h4><a name="UsageThreshold">3. Usage Threshold</a></h4>
  74. *
  75. * Each memory pool has a manageable attribute
  76. * called the <i>usage threshold</i> which has a default value supplied
  77. * by the Java virtual machine. The default value is platform-dependent.
  78. * The usage threshold can be set via the
  79. * {@link #setUsageThreshold setUsageThreshold} method.
  80. * If the threshold is set to a positive value, the usage threshold crossing
  81. * checking is enabled in this memory pool.
  82. * If the usage threshold is set to zero, usage
  83. * threshold crossing checking on this memory pool is disabled.
  84. * The {@link MemoryPoolMXBean#isUsageThresholdSupported} method can
  85. * be used to determine if this functionality is supported.
  86. * <p>
  87. * A Java virtual machine performs usage threshold crossing checking on a
  88. * memory pool basis at its best appropriate time, typically,
  89. * at garbage collection time.
  90. * Each memory pool maintains a {@link #getUsageThresholdCount
  91. * usage threshold count} that will get incremented
  92. * every time when the Java virtual machine
  93. * detects that the memory pool usage is crossing the threshold.
  94. * <p>
  95. * This manageable usage threshold attribute is designed for monitoring the
  96. * increasing trend of memory usage with low overhead.
  97. * Usage threshold may not be appropriate for some memory pools.
  98. * For example, a generational garbage collector, a common garbage collection
  99. * algorithm used in many Java virtual machine implementations,
  100. * manages two or more generations segregating objects by age.
  101. * Most of the objects are allocated in
  102. * the <em>youngest generation</em> (say a nursery memory pool).
  103. * The nursery memory pool is designed to be filled up and
  104. * collecting the nursery memory pool will free most of its memory space
  105. * since it is expected to contain mostly short-lived objects
  106. * and mostly are unreachable at garbage collection time.
  107. * In this case, it is more appropriate for the nursery memory pool
  108. * not to support a usage threshold. In addition,
  109. * if the cost of an object allocation
  110. * in one memory pool is very low (for example, just atomic pointer exchange),
  111. * the Java virtual machine would probably not support the usage threshold
  112. * for that memory pool since the overhead in comparing the usage with
  113. * the threshold is higher than the cost of object allocation.
  114. *
  115. * <p>
  116. * The memory usage of the system can be monitored using
  117. * <a href="#Polling">polling</a> or
  118. * <a href="#Notification">threshold notification</a> mechanisms.
  119. *
  120. * <ol type="a">
  121. * <li><a name="Polling"><b>Polling</b></a>
  122. * <p>
  123. * An application can continuously monitor its memory usage
  124. * by calling either the {@link #getUsage} method for all
  125. * memory pools or the {@link #isUsageThresholdExceeded} method
  126. * for those memory pools that support a usage threshold.
  127. * Below is example code that has a thread delicated for
  128. * task distribution and processing. At every interval,
  129. * it will determine if it should receive and process new tasks based
  130. * on its memory usage. If the memory usage exceeds its usage threshold,
  131. * it will redistribute all outstanding tasks to other VMs and
  132. * stop receiving new tasks until the memory usage returns
  133. * below its usage threshold.
  134. *
  135. * <pre>
  136. * // Assume the usage threshold is supported for this pool.
  137. * // Set the threshold to myThreshold above which no new tasks
  138. * // should be taken.
  139. * pool.setUsageThreshold(myThreshold);
  140. * ....
  141. *
  142. * boolean lowMemory = false;
  143. * while (true) {
  144. * if (pool.isUsageThresholdExceeded()) {
  145. * // potential low memory, so redistribute tasks to other VMs
  146. * lowMemory = true;
  147. * redistributeTasks();
  148. * // stop receiving new tasks
  149. * stopReceivingTasks();
  150. * } else {
  151. * if (lowMemory) {
  152. * // resume receiving tasks
  153. * lowMemory = false;
  154. * resumeReceivingTasks();
  155. * }
  156. * // processing outstanding task
  157. * ...
  158. * }
  159. * // sleep for sometime
  160. * try {
  161. * Thread.sleep(sometime);
  162. * } catch (InterruptedException e) {
  163. * ...
  164. * }
  165. * }
  166. * </pre>
  167. *
  168. * <hr>
  169. * The above example does not differentiate the case where
  170. * the memory usage has temporarily dropped below the usage threshold
  171. * from the case where the memory usage remains above the threshould
  172. * between two iterations. The usage threshold count returned by
  173. * the {@link #getUsageThresholdCount} method
  174. * can be used to determine
  175. * if the memory usage has returned below the threshold
  176. * between two polls.
  177. * <p>
  178. * Below shows another example that takes some action if a
  179. * memory pool is under low memory and ignores the memory usage
  180. * changes during the action processing time.
  181. *
  182. * <pre>
  183. * // Assume the usage threshold is supported for this pool.
  184. * // Set the threshold to myThreshold which determines if
  185. * // the application will take some action under low memory condition.
  186. * pool.setUsageThreshold(myThreshold);
  187. *
  188. * int prevCrossingCount = 0;
  189. * while (true) {
  190. * // A busy loop to detect when the memory usage
  191. * // has exceeded the threshold.
  192. * while (!pool.isUsageThresholdExceeded() ||
  193. * pool.getUsageThresholdCount() == prevCrossingCount) {
  194. * try {
  195. * Thread.sleep(sometime)
  196. * } catch (InterruptException e) {
  197. * ....
  198. * }
  199. * }
  200. *
  201. * // Do some processing such as check for memory usage
  202. * // and issue a warning
  203. * ....
  204. *
  205. * // Gets the current threshold count. The busy loop will then
  206. * // ignore any crossing of threshold happens during the processing.
  207. * prevCrossingCount = pool.getUsageThresholdCount();
  208. * }
  209. * </pre><hr>
  210. * </li>
  211. * <li><a name="ThresholdNotification"><b>Usage Threshold Notifications</b></a>
  212. * <p>
  213. * Usage threshold notification will be emitted by {@link MemoryMXBean}.
  214. * When the Java virtual machine detects that the memory usage of
  215. * a memory pool has reached or exceeded the usage threshold
  216. * the virtual machine will trigger the <tt>MemoryMXBean</tt> to emit an
  217. * {@link MemoryNotificationInfo#MEMORY_THRESHOLD_EXCEEDED
  218. * usage threshold exceeded notification}.
  219. * Another usage threshold exceeded notification will not be
  220. * generated until the usage has fallen below the threshold and
  221. * then exceeded it again.
  222. * <p>
  223. * Below is an example code implementing the same logic as the
  224. * first example above but using the usage threshold notification
  225. * mechanism to detect low memory conditions instead of polling.
  226. * In this example code, upon receiving notification, the notification
  227. * listener notifies another thread to perform the actual action
  228. * such as to redistribute outstanding tasks, stop receiving tasks,
  229. * or resume receiving tasks.
  230. * The <tt>handleNotification</tt> method should be designed to
  231. * do a very minimal amount of work and return without delay to avoid
  232. * causing delay in delivering subsequent notifications. Time-consuming
  233. * actions should be performed by a separate thread.
  234. * The notification listener may be invoked by multiple threads
  235. * concurrently; so the tasks performed by the listener
  236. * should be properly synchronized.
  237. *
  238. * <pre>
  239. * class MyListener implements javax.management.NotificationListener {
  240. * public void handleNotification(Notification notification, Object handback) {
  241. * String notifType = notification.getType();
  242. * if (notifType.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED)) {
  243. * // potential low memory, notify another thread
  244. * // to redistribute outstanding tasks to other VMs
  245. * // and stop receiving new tasks.
  246. * lowMemory = true;
  247. * notifyAnotherThread(lowMemory);
  248. * }
  249. * }
  250. * }
  251. *
  252. * // Register MyListener with MemoryMXBean
  253. * MemoryMXBean mbean = ManagementFactory.getMemoryMXBean();
  254. * NotificationEmitter emitter = (NotificationEmitter) mbean;
  255. * MyListener listener = new MyListener();
  256. * emitter.addNotificationListener(listener, null, null);
  257. *
  258. * // Assume this pool supports a usage threshold.
  259. * // Set the threshold to myThreshold above which no new tasks
  260. * // should be taken.
  261. * pool.setUsageThreshold(myThreshold);
  262. *
  263. * // Usage threshold detection is enabled and notification will be
  264. * // handled by MyListener. Continue for other processing.
  265. * ....
  266. *
  267. * </pre>
  268. * <hr>
  269. * <p>
  270. * There is no guarantee about when the <tt>MemoryMXBean</tt> will emit
  271. * a threshold notification and when the notification will be delivered.
  272. * When a notification listener is invoked, the memory usage of
  273. * the memory pool may have crossed the usage threshold more
  274. * than once.
  275. * The {@link MemoryNotificationInfo#getCount} method returns the number
  276. * of times that the memory usage has crossed the usage threshold
  277. * at the point in time when the notification was constructed.
  278. * It can be compared with the current usage threshold count returned
  279. * by the {@link #getUsageThresholdCount} method to determine if
  280. * such situation has occurred.
  281. * </li>
  282. * </ol>
  283. *
  284. * <h4><a name="CollectionThreshold">4. Collection Usage Threshold</a></h4>
  285. *
  286. * Collection usage threshold is a manageable attribute only applicable
  287. * to some garbage-collected memory pools.
  288. * After a Java virtual machine has expended effort in reclaiming memory
  289. * space by recycling unused objects in a memory pool at garbage collection
  290. * time, some number of bytes in the memory pools that are garbaged
  291. * collected will still be in use. The collection usage threshold
  292. * allows a value to be set for this number of bytes such
  293. * that if the threshold is exceeded,
  294. * a {@link MemoryNotificationInfo#MEMORY_THRESHOLD_EXCEEDED
  295. * collection usage threshold exceeded notification}
  296. * will be emitted by the {@link MemoryMXBean}.
  297. * In addition, the {@link #getCollectionUsageThresholdCount
  298. * collection usage threshold count} will then be incremented.
  299. *
  300. * <p>
  301. * The {@link MemoryPoolMXBean#isCollectionUsageThresholdSupported} method can
  302. * be used to determine if this functionality is supported.
  303. *
  304. * <p>
  305. * A Java virtual machine performs collection usage threshold checking
  306. * on a memory pool basis. This checking is enabled if the collection
  307. * usage threshold is set to a positive value.
  308. * If the collection usage threshold is set to zero, this checking
  309. * is disabled on this memory pool. Default value is zero.
  310. * The Java virtual machine performs the collection usage threshold
  311. * checking at garbage collection time.
  312. *
  313. * <p>
  314. * Some garbage-collected memory pools may
  315. * choose not to support the collection usage threshold. For example,
  316. * a memory pool is only managed by a continuous concurrent garbage
  317. * collector. Objects can be allocated in this memory pool by some thread
  318. * while the unused objects are reclaimed by the concurrent garbage
  319. * collector simultaneously. Unless there is a well-defined
  320. * garbage collection time which is the best appropriate time
  321. * to check the memory usage, the collection usage threshold should not
  322. * be supported.
  323. *
  324. * <p>
  325. * The collection usage threshold is designed for monitoring the memory usage
  326. * after the Java virtual machine has expended effort in reclaiming
  327. * memory space. The collection usage could also be monitored
  328. * by the polling and threshold notification mechanism
  329. * described above for the <a href="#UsageThreshold">usage threshold</a>
  330. * in a similar fashion.
  331. *
  332. * @see <a href="../../../javax/management/package-summary.html">
  333. * JMX Specification.</a>
  334. * @see <a href="package-summary.html#examples">
  335. * Ways to Access MXBeans</a>
  336. *
  337. * @author Mandy Chung
  338. * @version 1.18, 04/20/04
  339. * @since 1.5
  340. */
  341. public interface MemoryPoolMXBean {
  342. /**
  343. * Returns the name representing this memory pool.
  344. *
  345. * @return the name of this memory pool.
  346. */
  347. public String getName();
  348. /**
  349. * Returns the type of this memory pool.
  350. *
  351. * <p>
  352. * <b>MBeanServer access</b>:<br>
  353. * The mapped type of <tt>MemoryType</tt> is <tt>String</tt>
  354. * and the value is the name of the <tt>MemoryType</tt>.
  355. *
  356. * @return the type of this memory pool.
  357. */
  358. public MemoryType getType();
  359. /**
  360. * Returns an estimate of the memory usage of this memory pool.
  361. * This method returns <tt>null</tt>
  362. * if this memory pool is not valid (i.e. no longer exists).
  363. *
  364. * <p>
  365. * This method requests the Java virtual machine to make
  366. * a best-effort estimate of the current memory usage of this
  367. * memory pool. For some memory pools, this method may be an
  368. * expensive operation that requires some computation to determine
  369. * the estimate. An implementation should document when
  370. * this is the case.
  371. *
  372. * <p>This method is designed for use in monitoring system
  373. * memory usage and detecting low memory condition.
  374. *
  375. * <p>
  376. * <b>MBeanServer access</b>:<br>
  377. * The mapped type of <tt>MemoryUsage</tt> is
  378. * <tt>CompositeData</tt> with attributes as specified in
  379. * {@link MemoryUsage#from MemoryUsage}.
  380. *
  381. * @return a {@link MemoryUsage} object; or <tt>null</tt> if
  382. * this pool not valid.
  383. */
  384. public MemoryUsage getUsage();
  385. /**
  386. * Returns the peak memory usage of this memory pool since the
  387. * Java virtual machine was started or since the peak was reset.
  388. * This method returns <tt>null</tt>
  389. * if this memory pool is not valid (i.e. no longer exists).
  390. *
  391. * <p>
  392. * <b>MBeanServer access</b>:<br>
  393. * The mapped type of <tt>MemoryUsage</tt> is
  394. * <tt>CompositeData</tt> with attributes as specified in
  395. * {@link MemoryUsage#from MemoryUsage}.
  396. *
  397. * @return a {@link MemoryUsage} object representing the peak
  398. * memory usage; or <tt>null</tt> if this pool is not valid.
  399. *
  400. */
  401. public MemoryUsage getPeakUsage();
  402. /**
  403. * Resets the peak memory usage statistic of this memory pool
  404. * to the current memory usage.
  405. *
  406. * @throws java.lang.SecurityException if a security manager
  407. * exists and the caller does not have
  408. * ManagementPermission("control").
  409. */
  410. public void resetPeakUsage();
  411. /**
  412. * Tests if this memory pool is valid in the Java virtual
  413. * machine. A memory pool becomes invalid once the Java virtual
  414. * machine removes it from the memory system.
  415. *
  416. * @return <tt>true</tt> if the memory pool is valid in the running
  417. * Java virtual machine;
  418. * <tt>false</tt> otherwise.
  419. */
  420. public boolean isValid();
  421. /**
  422. * Returns the name of memory managers that manages this memory pool.
  423. * Each memory pool will be managed by at least one memory manager.
  424. *
  425. * @return an array of <tt>String</tt> objects, each is the name of
  426. * a memory manager managing this memory pool.
  427. */
  428. public String[] getMemoryManagerNames();
  429. /**
  430. * Returns the usage threshold value of this memory pool in bytes.
  431. * Each memory pool has a platform-dependent default threshold value.
  432. * The current usage threshold can be changed via the
  433. * {@link #setUsageThreshold setUsageThreshold} method.
  434. *
  435. * @return the usage threshold value of this memory pool in bytes.
  436. *
  437. * @throws UnsupportedOperationException if this memory pool
  438. * does not support a usage threshold.
  439. *
  440. * @see #isUsageThresholdSupported
  441. */
  442. public long getUsageThreshold();
  443. /**
  444. * Sets the threshold of this memory pool to the given <tt>threshold</tt>
  445. * value if this memory pool supports the usage threshold.
  446. * The usage threshold crossing checking is enabled in this memory pool
  447. * if the threshold is set to a positive value.
  448. * The usage threshold crossing checking is disabled
  449. * if it is set to zero.
  450. *
  451. * @param threshold the new threshold value in bytes. Must be non-negative.
  452. *
  453. * @throws IllegalArgumentException if <tt>threshold</tt> is negative
  454. * or greater than the maximum amount of memory for
  455. * this memory pool if defined.
  456. *
  457. * @throws UnsupportedOperationException if this memory pool
  458. * does not support a usage threshold.
  459. *
  460. * @throws java.lang.SecurityException if a security manager
  461. * exists and the caller does not have
  462. * ManagementPermission("control").
  463. *
  464. * @see #isUsageThresholdSupported
  465. * @see <a href="#UsageThreshold">Usage threshold</a>
  466. */
  467. public void setUsageThreshold(long threshold);
  468. /**
  469. * Tests if the memory usage of this memory pool
  470. * reaches or exceeds its usage threshold value.
  471. *
  472. * @return <tt>true</tt> if the memory usage of
  473. * this memory pool reaches or exceeds the threshold value;
  474. * <tt>false</tt> otherwise.
  475. *
  476. * @throws UnsupportedOperationException if this memory pool
  477. * does not support a usage threshold.
  478. */
  479. public boolean isUsageThresholdExceeded();
  480. /**
  481. * Returns the number of times that the memory usage has crossed
  482. * the usage threshold.
  483. *
  484. * @return the number of times that the memory usage
  485. * has crossed its usage threshold value.
  486. *
  487. * @throws UnsupportedOperationException if this memory pool
  488. * does not support a usage threshold.
  489. */
  490. public long getUsageThresholdCount();
  491. /**
  492. * Tests if this memory pool supports usage threshold.
  493. *
  494. * @return <tt>true</tt> if this memory pool supports usage threshold;
  495. * <tt>false</tt> otherwise.
  496. */
  497. public boolean isUsageThresholdSupported();
  498. /**
  499. * Returns the collection usage threshold value of this memory pool
  500. * in bytes. The default value is zero. The collection usage
  501. * threshold can be changed via the
  502. * {@link #setCollectionUsageThreshold setCollectionUsageThreshold} method.
  503. *
  504. * @return the collection usage threshold of this memory pool in bytes.
  505. *
  506. * @throws UnsupportedOperationException if this memory pool
  507. * does not support a collection usage threshold.
  508. *
  509. * @see #isCollectionUsageThresholdSupported
  510. */
  511. public long getCollectionUsageThreshold();
  512. /**
  513. * Sets the collection usage threshold of this memory pool to
  514. * the given <tt>threshold</tt> value.
  515. * When this threshold is set to positive, the Java virtual machine
  516. * will check the memory usage at its best appropriate time after it has
  517. * expended effort in recycling unused objects in this memory pool.
  518. * <p>
  519. * The collection usage threshold crossing checking is enabled
  520. * in this memory pool if the threshold is set to a positive value.
  521. * The collection usage threshold crossing checking is disabled
  522. * if it is set to zero.
  523. *
  524. * @param threhsold the new collection usage threshold value in bytes.
  525. * Must be non-negative.
  526. *
  527. * @throws IllegalArgumentException if <tt>threshold</tt> is negative
  528. * or greater than the maximum amount of memory for
  529. * this memory pool if defined.
  530. *
  531. * @throws UnsupportedOperationException if this memory pool
  532. * does not support a collection usage threshold.
  533. *
  534. * @throws java.lang.SecurityException if a security manager
  535. * exists and the caller does not have
  536. * ManagementPermission("control").
  537. *
  538. * @see #isCollectionUsageThresholdSupported
  539. * @see <a href="#CollectionThreshold">Collection usage threshold</a>
  540. */
  541. public void setCollectionUsageThreshold(long threhsold);
  542. /**
  543. * Tests if the memory usage of this memory pool after
  544. * the most recent collection on which the Java virtual
  545. * machine has expended effort has reached or
  546. * exceeded its collection usage threshold.
  547. * This method does not request the Java virtual
  548. * machine to perform any garbage collection other than its normal
  549. * automatic memory management.
  550. *
  551. * @return <tt>true</tt> if the memory usage of this memory pool
  552. * reaches or exceeds the collection usage threshold value
  553. * in the most recent collection;
  554. * <tt>false</tt> otherwise.
  555. *
  556. * @throws UnsupportedOperationException if this memory pool
  557. * does not support a usage threshold.
  558. */
  559. public boolean isCollectionUsageThresholdExceeded();
  560. /**
  561. * Returns the number of times that the Java virtual machine
  562. * has detected that the memory usage has reached or
  563. * exceeded the collection usage threshold.
  564. *
  565. * @return the number of times that the memory
  566. * usage has reached or exceeded the collection usage threshold.
  567. *
  568. * @throws UnsupportedOperationException if this memory pool
  569. * does not support a collection usage threshold.
  570. *
  571. * @see #isCollectionUsageThresholdSupported
  572. */
  573. public long getCollectionUsageThresholdCount();
  574. /**
  575. * Returns the memory usage after the Java virtual machine
  576. * most recently expended effort in recycling unused objects
  577. * in this memory pool.
  578. * This method does not request the Java virtual
  579. * machine to perform any garbage collection other than its normal
  580. * automatic memory management.
  581. * This method returns <tt>null</tt> if the Java virtual
  582. * machine does not support this method.
  583. *
  584. * <p>
  585. * <b>MBeanServer access</b>:<br>
  586. * The mapped type of <tt>MemoryUsage</tt> is
  587. * <tt>CompositeData</tt> with attributes as specified in
  588. * {@link MemoryUsage#from MemoryUsage}.
  589. *
  590. * @return a {@link MemoryUsage} representing the memory usage of
  591. * this memory pool after the Java virtual machine most recently
  592. * expended effort in recycling unused objects;
  593. * <tt>null</tt> if this method is not supported.
  594. */
  595. public MemoryUsage getCollectionUsage();
  596. /**
  597. * Tests if this memory pool supports a collection usage threshold.
  598. *
  599. * @return <tt>true</tt> if this memory pool supports the
  600. * collection usage threshold; <tt>false</tt> otherwise.
  601. */
  602. public boolean isCollectionUsageThresholdSupported();
  603. }