/** * Verify if the java virtual machine is in a very low memory condition. The memory is considered very low if less than half a * specified value is still available for processing. "Available" memory is calculated using <code>availableMemory()</code> * .The threshold value can be specified as the Mary property mary.lowmemory (in bytes). It defaults to 20000000 bytes. * * @return a boolean indicating whether or not the system is in very low memory condition. */ public static boolean veryLowMemoryCondition() { return MaryUtils.availableMemory() < lowMemoryThreshold() / 2; }
/** * Verify if the java virtual machine is in a low memory condition. The memory is considered low if less than a specified * value is still available for processing. "Available" memory is calculated using <code>availableMemory()</code>.The * threshold value can be specified as the Mary property mary.lowmemory (in bytes). It defaults to 20000000 bytes. * * @return a boolean indicating whether or not the system is in low memory condition. */ public static boolean lowMemoryCondition() { return MaryUtils.availableMemory() < lowMemoryThreshold(); }
/** * Verify if the java virtual machine is in a low memory condition. The memory is considered low if less than a specified * value is still available for processing. "Available" memory is calculated using <code>availableMemory()</code>.The * threshold value can be specified as the Mary property mary.lowmemory (in bytes). It defaults to 20000000 bytes. * * @return a boolean indicating whether or not the system is in low memory condition. */ public static boolean lowMemoryCondition() { return MaryUtils.availableMemory() < lowMemoryThreshold(); }
/** * Verify if the java virtual machine is in a very low memory condition. The memory is considered very low if less than half a * specified value is still available for processing. "Available" memory is calculated using <code>availableMemory()</code> * .The threshold value can be specified as the Mary property mary.lowmemory (in bytes). It defaults to 20000000 bytes. * * @return a boolean indicating whether or not the system is in very low memory condition. */ public static boolean veryLowMemoryCondition() { return MaryUtils.availableMemory() < lowMemoryThreshold() / 2; }
logger.info("Request couldn't be handled successfully."); if (MaryRuntimeUtils.lowMemoryCondition()) { logger.info("Low memory condition detected (only " + MaryUtils.availableMemory() + " bytes left). Triggering garbage collection."); Runtime.getRuntime().gc(); logger.info("After garbage collection: " + MaryUtils.availableMemory() + " bytes available.");
logger.info("Request couldn't be handled successfully."); if (MaryRuntimeUtils.lowMemoryCondition()) { logger.info("Low memory condition detected (only " + MaryUtils.availableMemory() + " bytes left). Triggering garbage collection."); Runtime.getRuntime().gc(); logger.info("After garbage collection: " + MaryUtils.availableMemory() + " bytes available.");
timingInfo.put(m, new Long(delta)); if (MaryRuntimeUtils.veryLowMemoryCondition()) { logger.info("Very low memory condition detected (only " + MaryUtils.availableMemory() + " bytes left). Triggering garbage collection."); Runtime.getRuntime().gc(); logger.info("After garbage collection: " + MaryUtils.availableMemory() + " bytes available.");
timingInfo.put(m, new Long(delta)); if (MaryRuntimeUtils.veryLowMemoryCondition()) { logger.info("Very low memory condition detected (only " + MaryUtils.availableMemory() + " bytes left). Triggering garbage collection."); Runtime.getRuntime().gc(); logger.info("After garbage collection: " + MaryUtils.availableMemory() + " bytes available.");
logger.info("Request couldn't be handled successfully."); if (MaryRuntimeUtils.lowMemoryCondition()) { logger.info("Low memory condition detected (only " + MaryUtils.availableMemory() + " bytes left). Triggering garbage collection."); Runtime.getRuntime().gc(); logger.info("After garbage collection: " + MaryUtils.availableMemory() + " bytes available.");
logger.info("Request couldn't be handled successfully."); if (MaryRuntimeUtils.lowMemoryCondition()) { logger.info("Low memory condition detected (only " + MaryUtils.availableMemory() + " bytes left). Triggering garbage collection."); Runtime.getRuntime().gc(); logger.info("After garbage collection: " + MaryUtils.availableMemory() + " bytes available.");
/** * Verify if the java virtual machine is in a low memory condition. The memory is considered low if less than a specified * value is still available for processing. "Available" memory is calculated using <code>availableMemory()</code>.The * threshold value can be specified as the Mary property mary.lowmemory (in bytes). It defaults to 20000000 bytes. * * @return a boolean indicating whether or not the system is in low memory condition. */ public static boolean lowMemoryCondition() { return MaryUtils.availableMemory() < lowMemoryThreshold(); }
/** * Verify if the java virtual machine is in a very low memory condition. The memory is considered very low if less than half a * specified value is still available for processing. "Available" memory is calculated using <code>availableMemory()</code> * .The threshold value can be specified as the Mary property mary.lowmemory (in bytes). It defaults to 20000000 bytes. * * @return a boolean indicating whether or not the system is in very low memory condition. */ public static boolean veryLowMemoryCondition() { return MaryUtils.availableMemory() < lowMemoryThreshold() / 2; }
logger.info("Request couldn't be handled successfully."); if (MaryRuntimeUtils.lowMemoryCondition()) { logger.info("Low memory condition detected (only " + MaryUtils.availableMemory() + " bytes left). Triggering garbage collection."); Runtime.getRuntime().gc(); logger.info("After garbage collection: " + MaryUtils.availableMemory() + " bytes available.");
timingInfo.put(m, new Long(delta)); if (MaryRuntimeUtils.veryLowMemoryCondition()) { logger.info("Very low memory condition detected (only " + MaryUtils.availableMemory() + " bytes left). Triggering garbage collection."); Runtime.getRuntime().gc(); logger.info("After garbage collection: " + MaryUtils.availableMemory() + " bytes available.");
logger.info("Request couldn't be handled successfully."); if (MaryRuntimeUtils.lowMemoryCondition()) { logger.info("Low memory condition detected (only " + MaryUtils.availableMemory() + " bytes left). Triggering garbage collection."); Runtime.getRuntime().gc(); logger.info("After garbage collection: " + MaryUtils.availableMemory() + " bytes available.");