|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mmtk.plan.Plan
org.mmtk.plan.Simple
org.mmtk.plan.StopTheWorld
org.mmtk.plan.generational.Gen
org.mmtk.plan.generational.copying.GenCopy
public class GenCopy
This class implements the functionality of a standard
two-generation copying collector. Nursery collections occur when
either the heap is full or the nursery is full. The nursery size
is determined by an optional command line argument. If undefined,
the nursery size is "infinite", so nursery collections only occur
when the heap is full (this is known as a flexible-sized nursery
collector). Thus both fixed and flexible nursery sizes are
supported. Full heap collections occur when the nursery size has
dropped to a statically defined threshold,
NURSERY_THRESHOLD
See the Jones & Lins GC book, chapter 7 for a detailed discussion of generational collection and section 7.3 for an overview of the flexible nursery behavior ("The Standard ML of New Jersey collector"), or go to Appel's paper "Simple generational garbage collection and fast allocation." SP&E 19(2):171--183, 1989.
All plans make a clear distinction between global and thread-local activities. Global activities must be synchronized, whereas no synchronization is required for thread-local activities. Instances of Plan map 1:1 to "kernel threads" (aka CPUs). Thus instance methods allow fast, unsychronized access to Plan utilities such as allocation and collection. Each instance rests on static resources (such as memory and virtual memory resources) which are "global" and therefore "static" members of Plan. This mapping of threads to instances is crucial to understanding the correctness and performance properties of this plan.
Field Summary | |
---|---|
(package private) static boolean |
hi
true if copying to "higher" semispace |
(package private) static CopySpace |
matureSpace0
The low half of the copying mature space. |
(package private) static CopySpace |
matureSpace1
The high half of the copying mature space. |
(package private) Trace |
matureTrace
|
(package private) static int |
MS0
|
(package private) static int |
MS1
|
Fields inherited from class org.mmtk.plan.StopTheWorld |
---|
postSanityPhase, preSanityPhase |
Constructor Summary | |
---|---|
GenCopy()
Constructor |
Method Summary | |
---|---|
Space |
activeMatureSpace()
Accessor method to allow the generic generational code in Gen.java to access the mature space. |
void |
collectionPhase(short phaseId)
Perform a (global) collection phase. |
protected boolean |
copyMature()
|
(package private) static CopySpace |
fromSpace()
|
(package private) static int |
fromSpaceDesc()
|
int |
getCollectionReserve()
Return the number of pages reserved for copying. |
int |
getMaturePhysicalPagesAvail()
Return the number of pages available for allocation into the mature space. |
int |
getPagesUsed()
Return the number of pages reserved for use given the pending allocation. |
protected void |
registerSpecializedMethods()
Register specialized methods. |
(package private) static CopySpace |
toSpace()
|
(package private) static int |
toSpaceDesc()
|
Methods inherited from class org.mmtk.plan.generational.Gen |
---|
collectionRequired, forceFullHeapCollection, fullyBooted, getPagesAvail, isCurrentGCNursery, lastCollectionFullHeap, printPreStats, requiresFullHeapCollection, sanityExpectedRC, traceFullHeap, willNeverMove |
Methods inherited from class org.mmtk.plan.StopTheWorld |
---|
processOptions |
Methods inherited from class org.mmtk.plan.Simple |
---|
replacePhase, replacePlaceholderPhase, switchNurseryZeroingApproach |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static boolean hi
true
if copying to "higher" semispace
static CopySpace matureSpace0
hi
is false
.
static final int MS0
static CopySpace matureSpace1
hi
is true
.
static final int MS1
final Trace matureTrace
Constructor Detail |
---|
public GenCopy()
Method Detail |
---|
protected boolean copyMature()
copyMature
in class Gen
static CopySpace toSpace()
static int toSpaceDesc()
static CopySpace fromSpace()
static int fromSpaceDesc()
public void collectionPhase(short phaseId)
collectionPhase
in class Gen
phaseId
- The unique id of the phase to perform.public int getPagesUsed()
getPagesUsed
in class Gen
public final int getCollectionReserve()
getCollectionReserve
in class Gen
public int getMaturePhysicalPagesAvail()
Gen
getMaturePhysicalPagesAvail
in class Gen
public Space activeMatureSpace()
Gen
activeMatureSpace
in class Gen
protected void registerSpecializedMethods()
Plan
registerSpecializedMethods
in class Gen
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |