| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|
com.newstep.solid.management
public class MemoryReservoir
holds and clears a number of memory reserves. The reservoir is used to enable
clean up from severe out of memory conditions when the handling itself requires
memory to complete (e.g. logging and alarming)
NOTE: the implementation of this class does not conform the the
NewStep Java logging convensions as it is used in the special out of memory
conditions during which logging may not be invoked
| Field Summary |
int |
|
int |
|
private final static String |
|
final static int |
|
final static int |
|
private static Logger |
|
private int |
|
private byte[][] |
|
private int |
|
| Constructor Summary |
public void |
|
public void |
|
| Method Summary |
public void |
|
public int |
|
public int |
|
public int |
|
public int |
|
private final static String className
Final.
Multiplicity:
1
Static.
final static int DEFAULT_NUM_RESERVES
Final.
Multiplicity:
1
Static.
final static int DEFAULT_RESERVE_SIZE
the default reservoir is 1Mb in 16 65k reserves
Final.
Multiplicity:
1
Static.
private static Logger logger
logging members
Multiplicity:
1
Static.
private int numReserves
Multiplicity:
1
int numReserves
private byte[][] reserves
reserve members
Multiplicity:
1
int reserveSize
private int reserveSize
Multiplicity:
1
public void MemoryReservoir (Integer reserveSize, Integer numReserves)
creates a reservoir of the specified size
Parameters:
reserveSize the size of each reserve
numReserves the number of reserves to be allocated in the reservoir
Stereotype:
create
public void MemoryReservoir ()
creates a reservoir with the default size
Stereotype:
create
public void freeAllReserves ()
frees all remaining reserves and requests garbage collection
public int freeReserve ()
frees the next available reserve. If no reserves are left it simply requests
garbage collection
Return:
the number of reserves still remaining in the reservoir
public int getNumReserves ()
Return:
the number or reserves remaining in the reservoir
public int getReserveSize ()
Return:
the size of each reserve in bytes
public int getSize ()
Return:
the total number of bytes remaining in the reserve
| | | | SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
|