|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--uk.org.ogsadai.common.MemoryUtilities
OGSA-DAI class/interface uk.org.dai.common.MemoryUtilities Provides utilities for managing, checking and logging memory usage.
| Field Summary | |
static double |
THRESHOLD
Threshold ratio for how full the JVM memory must be before an exception is thrown (to avoid a java.lang.OutOfMemoryError). |
| Constructor Summary | |
MemoryUtilities()
|
|
| Method Summary | |
static void |
checkMemory(int numberOfBytesToAdd,
int messageNumber,
org.apache.log4j.Logger logger)
Checks that the allocation of an extra number of bytes within the JVM will not go over the threshold ratio set for this system. |
static void |
checkMemory(int numberOfBytesToAdd,
org.apache.log4j.Logger logger)
Checks that the allocation of an extra number of bytes within the JVM will not go over the threshold ratio set for this system. |
static void |
checkMemory(java.lang.String stringToCopy,
int messageNumber,
org.apache.log4j.Logger logger)
Checks that the copying of a String within the JVM will not go over the threshold memory ratio set for this system. |
static void |
checkMemory(java.lang.String stringToCopy,
org.apache.log4j.Logger logger)
Checks that the copying of a String within the JVM will not go over the threshold memory ratio set for this system. |
static void |
logMemoryUsage(org.apache.log4j.Logger log)
Logs the current state of the JVM memory at DEBUG level to the MemoryUtilities Logger and the Logger provided. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final double THRESHOLD
| Constructor Detail |
public MemoryUtilities()
| Method Detail |
public static void checkMemory(int numberOfBytesToAdd,
org.apache.log4j.Logger logger)
throws CommonSystemException
numberOfBytesToAdd - The number of bytes of memory to be tested prior to allocation
CommonSystemException - if the ratio of used memory would be exceeded by allocating
the number of bytes specified
public static void checkMemory(java.lang.String stringToCopy,
org.apache.log4j.Logger logger)
throws CommonSystemException
stringToCopy - The string to be copied
CommonSystemException - if the ratio of used memory would be exceeded by allocating
the number of bytes specified
public static void checkMemory(java.lang.String stringToCopy,
int messageNumber,
org.apache.log4j.Logger logger)
throws CommonSystemException
stringToCopy - The string to be copiedmessageNumber - The message identifier to be used if an Exception is thrown
CommonSystemException - if the ratio of used memory would be exceeded by allocating
the number of bytes specified
public static void checkMemory(int numberOfBytesToAdd,
int messageNumber,
org.apache.log4j.Logger logger)
throws CommonSystemException
numberOfBytesToAdd - The number of bytes of memory to be tested prior to allocationmessageNumber - The message identifier to be used if an Exception is thrown
CommonSystemException - if the ratio of used memory would be exceeded by allocating
the number of bytes specifiedpublic static void logMemoryUsage(org.apache.log4j.Logger log)
[NUMBER] of [NUMBER] bytes in use. [NUMBER]%
log - Logger to log to (to track where we are in the process).
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||