equal
deleted
inserted
replaced
145 * <p> |
145 * <p> |
146 * An application can continuously monitor its memory usage |
146 * An application can continuously monitor its memory usage |
147 * by calling either the {@link #getUsage} method for all |
147 * by calling either the {@link #getUsage} method for all |
148 * memory pools or the {@link #isUsageThresholdExceeded} method |
148 * memory pools or the {@link #isUsageThresholdExceeded} method |
149 * for those memory pools that support a usage threshold. |
149 * for those memory pools that support a usage threshold. |
150 * Below is example code that has a thread delicated for |
150 * Below is example code that has a thread dedicated for |
151 * task distribution and processing. At every interval, |
151 * task distribution and processing. At every interval, |
152 * it will determine if it should receive and process new tasks based |
152 * it will determine if it should receive and process new tasks based |
153 * on its memory usage. If the memory usage exceeds its usage threshold, |
153 * on its memory usage. If the memory usage exceeds its usage threshold, |
154 * it will redistribute all outstanding tasks to other VMs and |
154 * it will redistribute all outstanding tasks to other VMs and |
155 * stop receiving new tasks until the memory usage returns |
155 * stop receiving new tasks until the memory usage returns |
189 * </pre> |
189 * </pre> |
190 * |
190 * |
191 * <hr> |
191 * <hr> |
192 * The above example does not differentiate the case where |
192 * The above example does not differentiate the case where |
193 * the memory usage has temporarily dropped below the usage threshold |
193 * the memory usage has temporarily dropped below the usage threshold |
194 * from the case where the memory usage remains above the threshould |
194 * from the case where the memory usage remains above the threshold |
195 * between two iterations. The usage threshold count returned by |
195 * between two iterations. The usage threshold count returned by |
196 * the {@link #getUsageThresholdCount} method |
196 * the {@link #getUsageThresholdCount} method |
197 * can be used to determine |
197 * can be used to determine |
198 * if the memory usage has returned below the threshold |
198 * if the memory usage has returned below the threshold |
199 * between two polls. |
199 * between two polls. |