uk.ac.leeds.ccg.andyt.projects.moses.utilities
Class TestMemory

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.projects.moses.utilities.TestMemory

public class TestMemory
extends java.lang.Object

A class with methods that help in testing computer memory.


Field Summary
protected  java.lang.Runtime _Runtime
           
 
Constructor Summary
TestMemory()
          Creates a new instance of TestMemory
 
Method Summary
 long getTotalFreeMemory()
          For returning the total free memory ( _Runtime.freeMemory() + ( _Runtime.maxMemory() - _Runtime.totalMemory() ) ) Even if this is zero then the JVM may be able to allocate memory in reserves?
protected  void init_Runtime()
          Initialises _Runtime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_Runtime

protected transient java.lang.Runtime _Runtime
Constructor Detail

TestMemory

public TestMemory()
Creates a new instance of TestMemory

Method Detail

init_Runtime

protected final void init_Runtime()
Initialises _Runtime


getTotalFreeMemory

public long getTotalFreeMemory()
For returning the total free memory Even if this is zero then the JVM may be able to allocate memory in reserves?

Returns:
The TotalFreeMemory available as calculated from _Runtime. If the returned value is lower than a minimum required to call a method then probably best to swap some data.