|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.core.Memory
public class Memory
A little helper class for Memory management. Very crude, since JDK 1.4 doesn't offer real Memory Management.
The memory management can be disabled by using the setEnabled(boolean) method.
setEnabled(boolean)
Constructor Summary | |
---|---|
Memory()
initializes the memory management without GUI support |
|
Memory(boolean useGUI)
initializes the memory management |
Method Summary | |
---|---|
long |
getCurrent()
returns the current memory consumption |
long |
getInitial()
returns the initial size of the JVM |
long |
getMax()
returns the maximum amount of memory that can be assigned |
boolean |
getUseGUI()
whether to display a dialog in case of a problem (= TRUE) or just print on stderr (= FALSE) |
boolean |
isEnabled()
returns whether the memory management is enabled |
boolean |
isOutOfMemory()
checks if there's still enough memory left. |
void |
setEnabled(boolean value)
sets whether the memory management is enabled |
void |
showOutOfMemory()
prints an error message if OutOfMemory (and if GUI is present a dialog), otherwise nothing happens. |
void |
stopThreads()
stops all the current threads, to make a restart possible |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Memory()
public Memory(boolean useGUI)
useGUI
- whether a GUI is presentMethod Detail |
---|
public boolean isEnabled()
public void setEnabled(boolean value)
public boolean getUseGUI()
public long getInitial()
public long getCurrent()
public long getMax()
public boolean isOutOfMemory()
public void showOutOfMemory()
isOutOfMemory()
,
#ENABLED
public void stopThreads()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |