edu.stanford.nlp.util
Class MemoryMonitor
java.lang.Object
edu.stanford.nlp.util.MemoryMonitor
public class MemoryMonitor
- extends Object
Utilities for monitoring memory use, including peak memory use.
MAX_SWAPS
public static final int MAX_SWAPS
- See Also:
- Constant Field Values
lastPoll
protected long lastPoll
pollEvery
protected long pollEvery
freeMem
protected int freeMem
usedSwap
protected int usedSwap
swaps
protected int swaps
r
protected Runtime r
MemoryMonitor
public MemoryMonitor()
MemoryMonitor
public MemoryMonitor(long millis)
pollAtMostEvery
public void pollAtMostEvery(long millis)
getMaxMemory
public int getMaxMemory()
getMaxAvailableMemory
public int getMaxAvailableMemory()
getMaxAvailableMemory
public int getMaxAvailableMemory(boolean accurate)
getUsedMemory
public int getUsedMemory()
getUsedMemory
public int getUsedMemory(boolean accurate)
getSystemFreeMemory
public int getSystemFreeMemory(boolean accurate)
getSystemUsedSwap
public int getSystemUsedSwap()
getSystemSwapsPerSec
public double getSystemSwapsPerSec()
parseFields
protected static ArrayList<String> parseFields(BufferedReader br,
String splitStr,
int[] lineNums,
int[] positions)
throws IOException
- Throws:
IOException
pollFree
public void pollFree(boolean force)
pollVMstat
public void pollVMstat(boolean force)
systemIsSwapping
public boolean systemIsSwapping()
toString
public String toString()
- Overrides:
toString
in class Object
main
public static void main(String[] args)
throws InterruptedException
- Throws:
InterruptedException
Stanford NLP Group