|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unister.semweb.drums.bucket.DynamicMemoryAllocater<Data>
Data
- an implementation of AbstractKVStorable
, e.g. GeneralStorable
public class DynamicMemoryAllocater<Data extends AbstractKVStorable>
This class manages the dynamic distribution of memory for the Buckets. It should be used as Singelton. This class doesn't really allocate memory. It just allows to manage virtual memory. An object which wants to be controlled easily asks for memory. This object also must give a report, when it doesn't need this memory anymore.
Field Summary | |
---|---|
static DynamicMemoryAllocater[] |
INSTANCES
An array, containing all instances of DynamicMemoryAllocater . |
Method Summary | ||
---|---|---|
int |
allocateNextChunk()
This method tries to mark memory as allocated. |
|
void |
freeMemory(long size)
Marks the given amount of memory as free to use. |
|
long |
getFreeMemory()
|
|
long |
getMaxMemory()
|
|
long |
getUsedMemory()
|
|
static
|
instantiate(DRUMSParameterSet<Data> gp)
Instantiates the DynamicMemoryAllocater , only if there is not already an instance |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static DynamicMemoryAllocater[] INSTANCES
DynamicMemoryAllocater
. Each DRUMS-table has its own.
Method Detail |
---|
public static <Data extends AbstractKVStorable> void instantiate(DRUMSParameterSet<Data> gp)
DynamicMemoryAllocater
, only if there is not already an instance
gp
- a pointer to the GlobalParameters used by this DRUMSpublic int allocateNextChunk()
MEMORY_CHUNK
and returns the number of bytes marked as allocated. This method doesn't really allocate memory.
public void freeMemory(long size)
size
- the size of memory (in bytes) to freepublic long getUsedMemory()
DynamicMemoryAllocater
public long getMaxMemory()
DynamicMemoryAllocater
public long getFreeMemory()
DynamicMemoryAllocater
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |