Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Memory.Manager
Class MarkAndSweep  view MarkAndSweep download MarkAndSweep.java

java.lang.Object
  extended byMemory.Manager.MarkAndSweep
All Implemented Interfaces:
GCConstants

public class MarkAndSweep
extends java.lang.Object
implements GCConstants

MarkAndSweep collector, adapted from Jikes RVM version written by Dick Attanasio.

Version:
$Id: MarkAndSweep.java,v 1.5 2003/05/12 10:05:19 joewhaley Exp $

Field Summary
private static Memory.Heap.BootHeap bootHeap
           
(package private) static boolean flag2nd
           
(package private) static boolean gc_collect_now
           
(package private) static int GC_RETRY_COUNT
           
(package private) static boolean gcInProgress
           
static Memory.Heap.ImmortalHeap immortalHeap
           
private static Memory.Heap.LargeHeap largeHeap
           
private static Memory.Heap.MallocHeap mallocHeap
           
static boolean movesObjects
           
(package private) static int SMALL_SPACE_MAX
           
private static Memory.Heap.SegregatedListHeap smallHeap
           
(package private) static int verbose
          Control chattering during progress of GC
static boolean writeBarrier
           
 
Fields inherited from interface Memory.Manager.GCConstants
GC_BLOCKSIZE, GC_MAX_SMALL_SIZE, GC_SIZES, GC_SIZEVALUES, LOG_GC_BLOCKSIZE
 
Constructor Summary
MarkAndSweep()
           
 
Method Summary
static java.lang.Object allocateArray(int numElements, int size, java.lang.Object[] tib)
          Allocate an array object.
static java.lang.Object allocateObject(int size, java.lang.Object[] tib)
          Allocate a "scalar" (non-array) Java object.
static long allSmallFreeMemory()
           
static long allSmallUsableMemory()
           
static void boot()
           
static void collect()
           
static long freeMemory()
           
(package private) static void gc_emptyWorkQueue()
           
(package private) static Memory.HeapAddress gc_getMatureSpace(int size)
           
(package private) static boolean gc_isLive(Memory.HeapAddress ref)
           
(package private) static void gc_scanObjectOrArray(Memory.HeapAddress objRef)
           
static void gc()
           
static void gc1(java.lang.String why, int size)
           
static boolean gcInProgress()
          "getter" function for gcInProgress
static void gcSetup(int numSysThreads)
           
static java.lang.Object getLiveObject(java.lang.Object obj)
           
static void heapExhausted(Memory.Heap.Heap heap, int size, int count)
          Handle heap exhaustion.
static void init()
          Setup done during bootimage building
private static void prepareNonParticipatingVPsForAllocation()
           
private static void prepareNonParticipatingVPsForGC()
           
static void printclass(Memory.HeapAddress ref)
           
static boolean processFinalizerCandidate(Memory.HeapAddress ref)
           
static void processPtrField(Memory.Address location)
          Process an object reference field during collection.
static Memory.HeapAddress processPtrValue(Memory.HeapAddress ref)
          Process an object reference (value) during collection.
(package private) static void processWriteBufferEntry(Memory.HeapAddress ref)
           
static void setupProcessor(Scheduler.jq_NativeThread st)
           
(package private) static void showParameter()
           
static long totalMemory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

verbose

static int verbose
Control chattering during progress of GC


movesObjects

public static final boolean movesObjects
See Also:
Constant Field Values

writeBarrier

public static final boolean writeBarrier
See Also:
Constant Field Values

SMALL_SPACE_MAX

static final int SMALL_SPACE_MAX
See Also:
Constant Field Values

GC_RETRY_COUNT

static final int GC_RETRY_COUNT
See Also:
Constant Field Values

flag2nd

static boolean flag2nd

gc_collect_now

static boolean gc_collect_now

bootHeap

private static Memory.Heap.BootHeap bootHeap

mallocHeap

private static Memory.Heap.MallocHeap mallocHeap

smallHeap

private static Memory.Heap.SegregatedListHeap smallHeap

immortalHeap

public static Memory.Heap.ImmortalHeap immortalHeap

largeHeap

private static Memory.Heap.LargeHeap largeHeap

gcInProgress

static boolean gcInProgress
Constructor Detail

MarkAndSweep

public MarkAndSweep()
Method Detail

gcInProgress

public static boolean gcInProgress()
"getter" function for gcInProgress


init

public static void init()
Setup done during bootimage building


boot

public static void boot()

showParameter

static void showParameter()

allocateObject

public static java.lang.Object allocateObject(int size,
                                              java.lang.Object[] tib)
                                       throws java.lang.OutOfMemoryError
Allocate a "scalar" (non-array) Java object.


allocateArray

public static java.lang.Object allocateArray(int numElements,
                                             int size,
                                             java.lang.Object[] tib)
                                      throws java.lang.OutOfMemoryError
Allocate an array object.


heapExhausted

public static void heapExhausted(Memory.Heap.Heap heap,
                                 int size,
                                 int count)
Handle heap exhaustion.


gcSetup

public static void gcSetup(int numSysThreads)

prepareNonParticipatingVPsForGC

private static void prepareNonParticipatingVPsForGC()

prepareNonParticipatingVPsForAllocation

private static void prepareNonParticipatingVPsForAllocation()

collect

public static void collect()

gc_getMatureSpace

static Memory.HeapAddress gc_getMatureSpace(int size)

gc_scanObjectOrArray

static void gc_scanObjectOrArray(Memory.HeapAddress objRef)

gc_emptyWorkQueue

static void gc_emptyWorkQueue()

gc

public static void gc()

gc1

public static void gc1(java.lang.String why,
                       int size)

totalMemory

public static long totalMemory()

freeMemory

public static long freeMemory()

allSmallFreeMemory

public static long allSmallFreeMemory()

allSmallUsableMemory

public static long allSmallUsableMemory()

gc_isLive

static boolean gc_isLive(Memory.HeapAddress ref)

setupProcessor

public static void setupProcessor(Scheduler.jq_NativeThread st)

printclass

public static void printclass(Memory.HeapAddress ref)

processWriteBufferEntry

static void processWriteBufferEntry(Memory.HeapAddress ref)

getLiveObject

public static java.lang.Object getLiveObject(java.lang.Object obj)

processFinalizerCandidate

public static boolean processFinalizerCandidate(Memory.HeapAddress ref)

processPtrField

public static void processPtrField(Memory.Address location)
Process an object reference field during collection.


processPtrValue

public static Memory.HeapAddress processPtrValue(Memory.HeapAddress ref)
Process an object reference (value) during collection.