SunSPOT API V5.0


com.sun.squawk
Class GarbageCollector

java.lang.Object
  extended by com.sun.squawk.GarbageCollector
Direct Known Subclasses:
Lisp2GenerationalCollector

public abstract class GarbageCollector
extends Object

Base class for all garbage collectors.


Field Summary
static boolean NATIVE_GC_ONLY
          If build.properties defines NATIVE_GC_ONLY= true, then define constant NATIVE_GC_ONLY = true.
 
Method Summary
 int getBytesAllocatedSinceLastGC()
          Get the number of bytes allocated since the last GC.
 long getBytesAllocatedTotal()
          Get the number of bytes allocated since JVM startup.
 long getBytesFreedTotal()
          Get the number of bytes freed in all collections
 long getBytesLastFreed()
          Get the number of bytes freed in the last collection
 long getBytesLastScanned()
          Get the number of bytes scanned in the last collection.
 long getLastGCTime()
          Gets the time taken by the last collection.
 long getMaxFullGCTime()
          Gets the time of the longest full GC.
 long getMaxGCTime()
          Get the time taken by the slowest garbage collection.
 long getMaxPartialGCTime()
          Gets the time of the longest partial GC.
 long getTotalFullGCTime()
          Gets the time taken by all full garbage collections.
 long getTotalGCTime()
          Gets the time taken by all GC.
 long getTotalPartialGCTime()
          Get the time taken by all partial garbage collections.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NATIVE_GC_ONLY

public static final boolean NATIVE_GC_ONLY
If build.properties defines NATIVE_GC_ONLY= true, then define constant NATIVE_GC_ONLY = true.

See Also:
Constant Field Values
Method Detail

getBytesAllocatedSinceLastGC

public int getBytesAllocatedSinceLastGC()
Get the number of bytes allocated since the last GC. May be inaccurate during a copyObjectGraph operation.

Returns:
bytes

getBytesAllocatedTotal

public long getBytesAllocatedTotal()
Get the number of bytes allocated since JVM startup. Watch out for overflow.

Returns:
bytes

getBytesFreedTotal

public final long getBytesFreedTotal()
Get the number of bytes freed in all collections

Returns:
bytes

getBytesLastFreed

public final long getBytesLastFreed()
Get the number of bytes freed in the last collection

Returns:
bytes

getBytesLastScanned

public final long getBytesLastScanned()
Get the number of bytes scanned in the last collection. This is a measure of how much "work" the collector did in the last GC. It measures the size of the heap that was last collected. With generational colelctors this may be much less than the size of the used heap. It can also be used to compute "bytes surviving collection" = getBytesLastScanned() - getBytesLastFreed().

Returns:
the number of bytes scanned in the last collection.

getLastGCTime

public final long getLastGCTime()
Gets the time taken by the last collection.

Returns:
ms

getMaxFullGCTime

public final long getMaxFullGCTime()
Gets the time of the longest full GC.

Returns:
ms

getMaxGCTime

public final long getMaxGCTime()
Get the time taken by the slowest garbage collection.

Returns:
ms

getMaxPartialGCTime

public final long getMaxPartialGCTime()
Gets the time of the longest partial GC.

Returns:
ms

getTotalFullGCTime

public final long getTotalFullGCTime()
Gets the time taken by all full garbage collections.

Returns:
ms

getTotalGCTime

public final long getTotalGCTime()
Gets the time taken by all GC.

Returns:
ms

getTotalPartialGCTime

public final long getTotalPartialGCTime()
Get the time taken by all partial garbage collections.

Returns:
ms

SunSPOT API V5.0


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