Terrier IR Platform
2.2.1

uk.ac.gla.terrier.utility
Class RuntimeMemoryChecker

java.lang.Object
  extended by uk.ac.gla.terrier.utility.RuntimeMemoryChecker
All Implemented Interfaces:
MemoryChecker

public class RuntimeMemoryChecker
extends java.lang.Object
implements MemoryChecker

A memory checker that uses the Java Runtime instance to check the amount of available memory. A given amount of memory must be kept free, however, this condition is only signalled if a given percentage of the JVM's potential memory usage has been exhausted.


Constructor Summary
RuntimeMemoryChecker()
          Default constructor.
RuntimeMemoryChecker(long _reserved, double _threshold)
          Construct a RuntimeMemoryChecker.
 
Method Summary
 boolean checkMemory()
          Returns true if memory is running low
 void reset()
          Reset the out of memory flag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuntimeMemoryChecker

public RuntimeMemoryChecker()
Default constructor. Uses ApplicationSetup.MEMORY_THRESHOLD_SINGLEPASS and memory.heap.usage for the default memory threshold amount (default 0.70).


RuntimeMemoryChecker

public RuntimeMemoryChecker(long _reserved,
                            double _threshold)
Construct a RuntimeMemoryChecker.

Parameters:
_reserved - The amount of memory that must be kept available.
_threshold - Percentage of possible memory that must be allocated before a lowMemory condition is allowed.
Method Detail

checkMemory

public boolean checkMemory()
Returns true if memory is running low

Specified by:
checkMemory in interface MemoryChecker

reset

public void reset()
Reset the out of memory flag

Specified by:
reset in interface MemoryChecker

Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow