Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD
 

com.newstep.solid.management
Class MemoryReservoir

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
MemoryReservoir(Integer reserveSize, Integer numReserves)
public void
Method Summary
public void
public int
public int
public int
public int
Field Detail
className
private final static String className
Final.
Multiplicity:
1
Static.
 

DEFAULT_NUM_RESERVES
final static int DEFAULT_NUM_RESERVES
Final.
Multiplicity:
1
Static.
 

DEFAULT_RESERVE_SIZE
final static int DEFAULT_RESERVE_SIZE
the default reservoir is 1Mb in 16 65k reserves
Final.
Multiplicity:
1
Static.
 

logger
private static Logger logger
logging members
Multiplicity:
1
Static.
 

numReserves
private int numReserves
Multiplicity:
1
 

numReserves
int numReserves
 

reserves
private byte[][] reserves
reserve members
Multiplicity:
1
 

reserveSize
int reserveSize
 

reserveSize
private int reserveSize
Multiplicity:
1
 
Constructor Detail
MemoryReservoir
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
 

MemoryReservoir
public void MemoryReservoir ()
 
creates a reservoir with the default size
Stereotype:
create
 
Method Detail
freeAllReserves
public void freeAllReserves ()
 
frees all remaining reserves and requests garbage collection
 

freeReserve
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
 

getNumReserves
public int getNumReserves ()
 
Return:
the number or reserves remaining in the reservoir
 

getReserveSize
public int getReserveSize ()
 
Return:
the size of each reserve in bytes
 

getSize
public int getSize ()
 
Return:
the total number of bytes remaining in the reserve
 

Class
Tree
          
SUMMARY: INNER | FIELD | CONSTR | METHODDETAIL: FIELD | CONSTR | METHOD