|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
public abstract class OutOfMemoryErrorHandler
A class to be extended so as to handle OutOfMemoryErrors.
Field Summary | |
---|---|
protected java.util.HashSet |
_Grid2DSquareCells
A HashSet of AbstractGrid2DSquareCell objects that have data that can be swapped to release memory for processing. |
static boolean |
_HandleOutOfMemoryErrorFalse
For ease of search and replace coding. |
static boolean |
_HandleOutOfMemoryErrorTrue
For ease of search and replace coding. |
protected int[] |
_MemoryReserve
Reserve memory that can be set to null and garbage collected so as to handle OutOfMemoryErrors. |
protected java.lang.Runtime |
_Runtime
|
Constructor Summary | |
---|---|
OutOfMemoryErrorHandler()
|
Method Summary | |
---|---|
static void |
_EnsureThereIsEnoughMemoryToContinue()
This allocates and deallocates a small amount of memory. |
protected java.util.HashMap |
_SwapToFileGrid2DSquareCellChunk()
Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells. |
java.util.HashMap |
_SwapToFileGrid2DSquareCellChunk(boolean _HandleOutOfMemoryError)
Attempts to swap any AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells. |
protected java.util.HashMap |
_SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
|
java.util.HashMap |
_SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID,
boolean _HandleOutOfMemoryError)
|
protected java.util.HashMap |
_SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell)
|
protected java.util.HashMap |
_SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
AbstractGrid2DSquareCell.ChunkID _ChunkID)
|
java.util.HashMap |
_SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
AbstractGrid2DSquareCell.ChunkID _ChunkID,
boolean _HandleOutOfMemoryError)
|
java.util.HashMap |
_SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
boolean _HandleOutOfMemoryError)
|
protected java.util.HashMap |
_SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
java.util.HashSet _ChunkIDs)
|
java.util.HashMap |
_SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
java.util.HashSet _ChunkIDHashSet,
boolean _HandleOutOfMemoryError)
|
protected java.util.HashMap |
_SwapToFileGrid2DSquareCellChunkExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet)
|
java.util.HashMap |
_SwapToFileGrid2DSquareCellChunkExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet,
boolean _HandleOutOfMemoryError)
|
protected void |
_SwapToFileGrid2DSquareCellChunks()
Attempts to swap all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells. |
void |
_SwapToFileGrid2DSquareCellChunks(boolean _HandleOutOfMemoryError)
Attempts to swap all AbstractGrid2DSquareCellChunk in this._Grid2DSquareCells. |
protected java.util.HashMap |
_SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID. |
java.util.HashMap |
_SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID,
boolean _HandleOutOfMemoryError)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID. |
protected java.util.HashMap |
_SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID. |
protected java.util.HashMap |
_SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
AbstractGrid2DSquareCell.ChunkID _ChunkID)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID. |
java.util.HashMap |
_SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
AbstractGrid2DSquareCell.ChunkID _ChunkID,
boolean _HandleOutOfMemoryError)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID. |
java.util.HashMap |
_SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
boolean _HandleOutOfMemoryError)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkID _ChunkID. |
protected java.util.HashMap |
_SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell,
java.util.HashSet _ChunkIDs)
Attempts to Swap all AbstractGrid2DSquareCell.ChunkIDs in this._Grid2DSquareCells except those with AbstractGrid2DSquareCell.ChunkIDs in _ChunkIDs. |
protected java.util.HashMap |
_SwapToFileGrid2DSquareCellChunksExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap)
|
java.util.HashMap |
_SwapToFileGrid2DSquareCellChunksExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap,
boolean _HandleOutOfMemoryError)
|
void |
clear_MemoryReserve()
Clears _MemoryReserve by setting it to null and calling the garbage collector. |
java.util.HashSet |
get_Grid2DSquareCells()
|
int[] |
get_MemoryReserve()
|
double[][] |
getNormalDistributionKernelWeights(AbstractGrid2DSquareCell _Grid2DSquareCell,
double _Distance,
boolean _HandleOutOfMemoryError)
|
protected long |
getTotalFreeMemory()
For returning the total free memory ( _Runtime.freeMemory() + ( _Runtime.maxMemory() - _Runtime.totalMemory() ) ) Even if this is zero then the JVM may be able to allocate memory in reserves? |
long |
getTotalFreeMemory(boolean _HandleOutOfMemoryError)
For returning the total free memory ( _Runtime.freeMemory() + ( _Runtime.maxMemory() - _Runtime.totalMemory() ) ) Even if this is zero then the JVM may be able to allocate memory in reserves? |
protected void |
init_Grid2DSquareCells_MemoryReserve(java.util.HashSet _Grid2DSquareCells)
|
void |
init_Grid2DSquareCells_MemoryReserve(java.util.HashSet _Grid2DSquareCells,
boolean _HandleOutOfMemoryError)
|
protected void |
init_Grid2DSquareCells()
Initialises _Grid2DSquareCells |
protected void |
init_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells)
Initialises _Grid2DSquareCells |
void |
init_MemoryReserve(AbstractGrid2DSquareCell.ChunkID _ChunkID,
boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve. |
void |
init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell,
AbstractGrid2DSquareCell.ChunkID _ChunkID,
boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve. |
void |
init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell,
boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve. |
void |
init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell,
java.util.HashSet _ChunkIDs,
boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve. |
void |
init_MemoryReserve(boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve. |
void |
init_MemoryReserve(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap,
boolean _HandleOutOfMemoryError)
Initialises _MemoryReserve. |
protected void |
init_Runtime()
Initialises _Runtime |
java.io.File |
initFile(java.io.File _File,
java.lang.String _String,
boolean _HandleOutOfMemoryError)
For initialising a File from File _File and String _String. |
java.io.File |
initFile(java.lang.String _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 _String_0,
java.lang.String _String_1,
boolean _HandleOutOfMemoryError)
|
java.lang.String |
println(java.lang.String _String,
java.lang.String _StringToDuplicateAndReturn,
boolean _HandleOutOfMemoryError)
|
void |
set_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells)
Sets this._Grid2DSquareCells to _Grid2DSquareCells. |
protected void |
set_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells,
boolean _HandleOutOfMemoryError)
Sets this._Grid2DSquareCells to _Grid2DSquareCells |
double |
sin(double value,
boolean _HandleOutOfMemoryError)
|
java.lang.String |
toString(double _double,
boolean _HandleOutOfMemoryError)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient java.util.HashSet _Grid2DSquareCells
protected transient java.lang.Runtime _Runtime
public static final boolean _HandleOutOfMemoryErrorFalse
public static final boolean _HandleOutOfMemoryErrorTrue
protected transient int[] _MemoryReserve
Constructor Detail |
---|
public OutOfMemoryErrorHandler()
Method Detail |
---|
protected final void init_Runtime()
protected void init_Grid2DSquareCells()
protected void init_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells)
public java.util.HashSet get_Grid2DSquareCells()
public void set_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells)
protected void set_Grid2DSquareCells(java.util.HashSet _Grid2DSquareCells, boolean _HandleOutOfMemoryError)
_Grid2DSquareCells
- The HashSet this._Grid2DSquareCells is set to.public void init_Grid2DSquareCells_MemoryReserve(java.util.HashSet _Grid2DSquareCells, boolean _HandleOutOfMemoryError)
_Grid2DSquareCells
- A HashSet used for initialisation.protected void init_Grid2DSquareCells_MemoryReserve(java.util.HashSet _Grid2DSquareCells)
_Grid2DSquareCells
- A HashSet used for initialisation.public int[] get_MemoryReserve()
public final 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.public final void init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell, boolean _HandleOutOfMemoryError)
_Grid2DSquareCell
- _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.public final void init_MemoryReserve(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
_ChunkID
- _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.public final void init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
_Grid2DSquareCell
- _ChunkID
- _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.public final void init_MemoryReserve(AbstractGrid2DSquareCell _Grid2DSquareCell, java.util.HashSet _ChunkIDs, boolean _HandleOutOfMemoryError)
_Grid2DSquareCell
- _ChunkIDs
- HashSet of AbstractGrid2DSquareCell.ChunkIDs_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.public void init_MemoryReserve(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap, boolean _HandleOutOfMemoryError)
_Grid2DSquareCell_ChunkIDHashSet_HashMap
- HashMap with AbstractGrid2DSquareCell as
keys and a respective HashSet of AbstractGrid2DSquareCell.ChunkIDs. Identifying
those ChunkIDs not to be swapped from the AbstractGrid2DSquareCell._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.public final void clear_MemoryReserve()
public static void _EnsureThereIsEnoughMemoryToContinue()
protected long getTotalFreeMemory()
public long getTotalFreeMemory(boolean _HandleOutOfMemoryError)
public void _SwapToFileGrid2DSquareCellChunks(boolean _HandleOutOfMemoryError)
_HandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught in this method then swap
operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected void _SwapToFileGrid2DSquareCellChunks()
public java.util.HashMap _SwapToFileGrid2DSquareCellChunk(boolean _HandleOutOfMemoryError)
_HandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught in this method then swap
operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
protected java.util.HashMap _SwapToFileGrid2DSquareCellChunk()
public java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
_ChunkID
- The AbstractGrid2DSquareCell.ChunkID not to be swapped.
protected java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
_ChunkID
- The AbstractGrid2DSquareCell.ChunkID not to be swapped.
public java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet, boolean _HandleOutOfMemoryError)
_Grid2DSquareCell_ChunkIDHashSet
- HashMap with AbstractGrid2DSquareCell as
keys and a respective HashSet of AbstractGrid2DSquareCell.ChunkIDs. Identifying
those ChunkIDs not to be swapped from the AbstractGrid2DSquareCell.
protected java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet)
_Grid2DSquareCell_ChunkIDHashSet
- HashMap with AbstractGrid2DSquareCell as
keys and a respective HashSet of AbstractGrid2DSquareCell.ChunkIDs. Identifying
those ChunkIDs not to be swapped from the AbstractGrid2DSquareCell.
public java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, java.util.HashSet _ChunkIDHashSet, boolean _HandleOutOfMemoryError)
_Grid2DSquareCell
- AbstractGrid2DSquareCell that's chunks are not to be swapped.
protected java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, java.util.HashSet _ChunkIDs)
_Grid2DSquareCell
- AbstractGrid2DSquareCell that's chunks are not to be swapped.
public java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
_Grid2DSquareCell
- AbstractGrid2DSquareCell that's chunks are not to be swapped._ChunkID
- The AbstractGrid2DSquareCell.ChunkID not to be swapped.
protected java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCell.ChunkID _ChunkID)
_Grid2DSquareCell
- AbstractGrid2DSquareCell that's chunks are not to be swapped._ChunkID
- The AbstractGrid2DSquareCell.ChunkID not to be swapped.
public java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, boolean _HandleOutOfMemoryError)
_Grid2DSquareCell
- AbstractGrid2DSquareCell that's chunks are not to be swapped.
protected java.util.HashMap _SwapToFileGrid2DSquareCellChunkExcept(AbstractGrid2DSquareCell _Grid2DSquareCell)
_Grid2DSquareCell
- AbstractGrid2DSquareCell that's chunks are not to be swapped.
public java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
_ChunkID
- The AbstractGrid2DSquareCell.ChunkID not to be
swapped.
protected java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell.ChunkID _ChunkID)
_ChunkID
- The AbstractGrid2DSquareCell.ChunkID not to be
swapped.
public java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, boolean _HandleOutOfMemoryError)
_Grid2DSquareCell
- AbstractGrid2DSquareCell that's chunks are not to be swapped.
swapped.
protected java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell)
_Grid2DSquareCell
- AbstractGrid2DSquareCell that's chunks are not to be swapped.
public java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCell.ChunkID _ChunkID, boolean _HandleOutOfMemoryError)
_Grid2DSquareCell
- AbstractGrid2DSquareCell that's chunks are not to be swapped._ChunkID
- The AbstractGrid2DSquareCell.ChunkID not to be
swapped.
protected java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, AbstractGrid2DSquareCell.ChunkID _ChunkID)
_Grid2DSquareCell
- AbstractGrid2DSquareCell that's chunks are not to be swapped._ChunkID
- The AbstractGrid2DSquareCell.ChunkID not to be
swapped.
protected java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(AbstractGrid2DSquareCell _Grid2DSquareCell, java.util.HashSet _ChunkIDs)
_Grid2DSquareCell
- AbstractGrid2DSquareCell that's chunks are not to be swapped._ChunkIDs
- The AbstractGrid2DSquareCell.ChunkID not to be
swapped.
public java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap, boolean _HandleOutOfMemoryError)
protected java.util.HashMap _SwapToFileGrid2DSquareCellChunksExcept(java.util.HashMap _Grid2DSquareCell_ChunkIDHashSet_HashMap)
public java.lang.String initString(int length, boolean _HandleOutOfMemoryError)
public java.lang.String initString(java.lang.String _String_0, java.lang.String _String_1, boolean _HandleOutOfMemoryError)
public java.io.File initFile(java.lang.String _String, boolean _HandleOutOfMemoryError) throws java.io.IOException
java.io.IOException
public java.io.File initFile(java.io.File _File, java.lang.String _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 _String, java.lang.String _StringToDuplicateAndReturn, boolean _HandleOutOfMemoryError)
public double sin(double value, boolean _HandleOutOfMemoryError)
public java.lang.String toString(double _double, boolean _HandleOutOfMemoryError)
public double[][] getNormalDistributionKernelWeights(AbstractGrid2DSquareCell _Grid2DSquareCell, double _Distance, boolean _HandleOutOfMemoryError)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |