SunSPOT API V5.0


com.sun.squawk
Class GC

java.lang.Object
  extended by com.sun.squawk.GC

public class GC
extends Object

Pure static class that handles object creation and GC control and monitoring. The particular GC implementation used is a subclass of GarbageCollector. Many of the "public" methods of this class are actually "suite-private". See the file "squawk.library.properties" for the list of exported methods.


Method Summary
static long freeMemory()
          Returns the amount of free memory in the system.
static GarbageCollector getCollector()
          Gets a reference to the installed collector.
static int getFullCount()
          Returns the number of full-heap collections.
static int getPartialCount()
          Returns the number of partial-heap collections.
static int getTotalCount()
          Returns the total number of garbage collections that have been performed by the VM.
static long totalMemory()
          Returns the total amount of RAM memory in the Squawk Virtual Machine.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

freeMemory

public static long freeMemory()
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.

getCollector

public static GarbageCollector getCollector()
Gets a reference to the installed collector.

Returns:
a reference to the installed collector

getFullCount

public static int getFullCount()
Returns the number of full-heap collections.

Returns:
the count of full-heap collections.

getPartialCount

public static int getPartialCount()
Returns the number of partial-heap collections.

Returns:
the count of partial-heap collections.

getTotalCount

public static int getTotalCount()
Returns the total number of garbage collections that have been performed by the VM.

Returns:
the total count of collections.

totalMemory

public static long totalMemory()
Returns the total amount of RAM memory in the Squawk 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.

SunSPOT API V5.0


Copyright � 2006-2008 Sun Microsystems, Inc. All Rights Reserved.