|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.leeds.ccg.andyt.generic.memory.Generic_OutOfMemoryErrorHandler
public abstract class Generic_OutOfMemoryErrorHandler
A class to be extended so as to handle OutOfMemoryErrors.
Field Summary | |
---|---|
Generic_TestMemory |
_Generic_TestMemory
|
boolean |
_HandleOutOfMemoryError_boolean
|
protected int[] |
_MemoryReserve
Reserve memory that can be set to null and garbage collected so as to handle OutOfMemoryErrors. |
static int |
Default_Memory_Threshold
|
static boolean |
HandleOutOfMemoryErrorFalse
For ease of search and replace coding. |
static boolean |
HandleOutOfMemoryErrorTrue
For ease of search and replace coding. |
Constructor Summary | |
---|---|
Generic_OutOfMemoryErrorHandler()
|
Method Summary | |
---|---|
void |
clear_MemoryReserve()
Clears _MemoryReserve by setting it to null and calling the garbage collector. |
protected Generic_TestMemory |
get_Generic_TestMemory()
For initialising and returning _Generic_TestMemory. |
int[] |
get_MemoryReserve()
|
java.lang.Runtime |
getRuntime()
May initialise _Generic_TestMemory and _Generic_TestMemory._Runtime. |
protected long |
getTotalFreeMemory()
return get_Generic_TestMemory().getTotalFreeMemory();
|
long |
getTotalFreeMemory(boolean handleOutOfMemoryError)
For returning the total free memory available to the JVM. |
protected void |
init_MemoryReserve()
Initialises _MemoryReserve as an int[] of size Default_Memory_Threshold. |
void |
init_MemoryReserve(boolean handleOutOfMemoryError)
Initialises _MemoryReserve. |
protected void |
init_MemoryReserve(int size)
Initialises _MemoryReserve as an array of size given by size. |
java.io.File |
initFile(java.io.File a_File,
java.lang.String a_String,
boolean handleOutOfMemoryError)
For initialising a File from File _File and String _String. |
java.io.File |
initFile(java.lang.String a_String,
boolean handleOutOfMemoryError)
For initialising a File from String _String. |
java.io.File |
initFileDirectory(java.io.File _ParentFile,
java.lang.String _String,
boolean handleOutOfMemoryError)
For initialising a File Directory from File _ParentFile and String _String. |
java.lang.String |
initString(int length,
boolean handleOutOfMemoryError)
For initialising a String of length length. |
java.lang.String |
initString(java.lang.String a_String,
java.lang.String b_String,
boolean handleOutOfMemoryError)
|
java.lang.String |
println(java.lang.String a_String,
java.lang.String a_StringToDuplicateAndReturn,
boolean handleOutOfMemoryError)
|
void |
set_MemoryReserve(int[] a_MemoryReserve)
this._MemoryReserve = a_MemoryReserve; |
double |
sin(double value,
boolean handleOutOfMemoryError)
|
abstract boolean |
swapToFile_DataAny()
|
abstract boolean |
swapToFile_DataAny(boolean handleOutOfMemoryError)
|
java.lang.String |
toString(double a_double,
boolean handleOutOfMemoryError)
|
protected abstract boolean |
tryToEnsureThereIsEnoughMemoryToContinue()
For ensuring robustness in handling OutOfMemoryError and to try to prevent them being thrown. |
abstract boolean |
tryToEnsureThereIsEnoughMemoryToContinue(boolean handleOutOfMemoryError)
A method to ensure there is enough memory to continue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public transient Generic_TestMemory _Generic_TestMemory
public boolean _HandleOutOfMemoryError_boolean
public static final int Default_Memory_Threshold
public static final boolean HandleOutOfMemoryErrorFalse
public static final boolean HandleOutOfMemoryErrorTrue
protected transient int[] _MemoryReserve
Constructor Detail |
---|
public Generic_OutOfMemoryErrorHandler()
Method Detail |
---|
public abstract boolean swapToFile_DataAny()
public abstract boolean swapToFile_DataAny(boolean handleOutOfMemoryError)
public java.lang.Runtime getRuntime()
protected final void init_MemoryReserve(int size)
size
- Size that _MemoryReserve is initialised to.public int[] get_MemoryReserve()
public void set_MemoryReserve(int[] a_MemoryReserve)
public void init_MemoryReserve(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught, swap operations are initiated,
then the method is re-called.
If false then OutOfMemoryErrors are caught and thrown.protected void init_MemoryReserve()
public final void clear_MemoryReserve()
protected abstract boolean tryToEnsureThereIsEnoughMemoryToContinue()
protected Generic_TestMemory get_Generic_TestMemory()
public abstract boolean tryToEnsureThereIsEnoughMemoryToContinue(boolean handleOutOfMemoryError)
handleOutOfMemoryError
-
protected long getTotalFreeMemory()
return get_Generic_TestMemory().getTotalFreeMemory();
public long getTotalFreeMemory(boolean handleOutOfMemoryError)
public java.lang.String initString(int length, boolean handleOutOfMemoryError)
public java.lang.String initString(java.lang.String a_String, java.lang.String b_String, boolean handleOutOfMemoryError)
public java.io.File initFile(java.lang.String a_String, boolean handleOutOfMemoryError) throws java.io.IOException
java.io.IOException
public java.io.File initFile(java.io.File a_File, java.lang.String a_String, boolean handleOutOfMemoryError) throws java.io.IOException
java.io.IOException
public java.io.File initFileDirectory(java.io.File _ParentFile, java.lang.String _String, boolean handleOutOfMemoryError) throws java.io.IOException
java.io.IOException
public java.lang.String println(java.lang.String a_String, java.lang.String a_StringToDuplicateAndReturn, boolean handleOutOfMemoryError)
public double sin(double value, boolean handleOutOfMemoryError)
public java.lang.String toString(double a_double, boolean handleOutOfMemoryError)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |