/* * Host.java * * Created on September 23, 2001, 4:43 PM */ package jicos.system; /** Tasks use this interface to get their host's attributes. * * @author Peter Cappello * @version 1.0 */ public interface Host { /** * Returns the total amount of memory in the Java Virtual Machine. * The value returned by this method may vary over time, depending on the * host environment. * * Note that the amount of memory required to hold an object of any given * type may be implementation-dependent. * * @returns the total amount of memory currently available for current and * future objects, measured in bytes. */ public long totalMemory(); /** * Returns the amount of free memory in the system. Calling the gc method * may result in increasing the value returned by freeMemory. * * @returns an approximation to the total amount of memory currently * available for future allocated objects, measured in bytes. */ public long freeMemory(); /** * Requires JDK 1.4 * @returns the number of processors available to the Java virtual machine. */ public int availableProcessors(); }