|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.expasy.jpl.commons.base.mem.ObjectSizeEstimator
public final class ObjectSizeEstimator
Estimate the average memory (in bytes) used to store an object from a collection of objects.
| Method Summary | |
|---|---|
double |
getAvgSizeOfObject()
|
double |
getDefaultMemoryRatio()
|
double |
getFreeMemoryRatio()
|
int |
getMaxObjectNumber()
|
long |
getMemoryCap()
|
long |
getMinMemoryForEstimation()
|
double |
getUsedMemorySize()
|
void |
init()
|
boolean |
isBeyondMemoryCap(long memorySize)
Test if memory is sufficient to store all. |
boolean |
isSufficientDataForEstimation()
|
void |
keepTrack()
|
long |
maxMemoryBlock(long memorySize)
|
static ObjectSizeEstimator |
newInstance()
|
void |
setBlockMemoryLimit(long size)
Set the memory limit. |
void |
setMaxMemoryRatio(double ratio)
Set the max free memory ratio. |
void |
start()
Init the memory size estimation. |
void |
stop(int elementNumber)
Stop the current memory size estimation. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static ObjectSizeEstimator newInstance()
public void init()
public void setBlockMemoryLimit(long size)
size - the max bytes.public void setMaxMemoryRatio(double ratio)
ratio - the maximum allocated part of the memory.public double getDefaultMemoryRatio()
public double getFreeMemoryRatio()
public void start()
public void keepTrack()
public void stop(int elementNumber)
elementNumber - the number of instanciated elements.public final double getAvgSizeOfObject()
public final double getUsedMemorySize()
public int getMaxObjectNumber()
public long getMemoryCap()
public boolean isBeyondMemoryCap(long memorySize)
memorySize - the memory to compare with limits.
public final long getMinMemoryForEstimation()
public boolean isSufficientDataForEstimation()
public long maxMemoryBlock(long memorySize)
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||