|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.MemoryChecker
public class MemoryChecker
MemoryChecker
is a Singleton implementation, that maintains the memory usage.
Constructor Summary | |
---|---|
protected |
MemoryChecker()
Initializes the singleton instance. |
Method Summary | |
---|---|
boolean |
enoughMemoryAvailable()
Checks whether there is enough memory available. |
static MemoryChecker |
getInstance()
Singleton method for returning the Singleton instance. |
long |
getMaximumMemory()
Returns the maximum amount of memory that can be used. |
double |
getMaximumMemoryUsage()
Returns the maximum memory usage in percent. |
static long |
getUsedVMMemory()
Returns the amount of already used memory. |
void |
makeMemoryUsageSnapshot()
Checks the memory usage status and makes a statistical snapshot. |
void |
setMaximumMemoryUsage(double maxUsage)
Sets the maximum memory usage in percent. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected MemoryChecker()
Method Detail |
---|
public static MemoryChecker getInstance()
MemoryChecker
Singleton instance.public static long getUsedVMMemory()
public long getMaximumMemory()
public void setMaximumMemoryUsage(double maxUsage)
maxUsage
- The maximum usage.public double getMaximumMemoryUsage()
public void makeMemoryUsageSnapshot()
public boolean enoughMemoryAvailable()
makeMemoryUsageSnapshot()
. This method returns true
, if the average memory usage value fits into memory; otherwise
false
.
true
, if enough memory is available; otherwise false
.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |