|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.plan.Plan org.mmtk.plan.Simple org.mmtk.plan.StopTheWorld org.mmtk.plan.copyms.CopyMS
public class CopyMS
This class implements the global state of a full-heap collector with a copying nursery and mark-sweep mature space. Unlike a full generational collector, there is no write barrier, no remembered set, and every collection is full-heap.
All plans make a clear distinction between global and thread-local activities, and divides global and local state into separate class hierarchies. Global activities must be synchronized, whereas no synchronization is required for thread-local activities. There is a single instance of Plan (or the appropriate sub-class), and a 1:1 mapping of PlanLocal to "kernel threads" (aka CPUs). Thus instance methods of PlanLocal allow fast, unsychronized access to functions such as allocation and collection.
The global instance defines and manages static resources (such as memory and virtual memory resources). This mapping of threads to instances is crucial to understanding the correctness and performance properties of MMTk plans.
Field Summary | |
---|---|
static int |
ALLOC_MS
|
static int |
ALLOC_NURSERY
|
static int |
MARK_SWEEP
|
static MarkSweepSpace |
msSpace
|
static int |
NURSERY
|
static CopySpace |
nurserySpace
|
static int |
SCAN_COPYMS
|
Trace |
trace
|
Fields inherited from class org.mmtk.plan.StopTheWorld |
---|
postSanityPhase, preSanityPhase |
Constructor Summary | |
---|---|
CopyMS()
Constructor. |
Method Summary | |
---|---|
void |
collectionPhase(short phaseId)
Perform a (global) collection phase. |
boolean |
collectionRequired(boolean spaceFull,
Space space)
This method controls the triggering of a GC. |
void |
fullyBooted()
|
int |
getCollectionReserve()
Return the number of pages reserved for collection. |
int |
getPagesAvail()
Return the number of pages available for allocation. |
int |
getPagesUsed()
Return the number of pages reserved for use given the pending allocation. |
protected void |
registerSpecializedMethods()
Register specialized methods. |
int |
sanityExpectedRC(ObjectReference object,
int sanityRootRC)
Return the expected reference count. |
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 |
---|
public static final CopySpace nurserySpace
public static final MarkSweepSpace msSpace
public static final int NURSERY
public static final int MARK_SWEEP
public static final int ALLOC_NURSERY
public static final int ALLOC_MS
public static final int SCAN_COPYMS
public final Trace trace
Constructor Detail |
---|
public CopyMS()
Method Detail |
---|
public final void collectionPhase(short phaseId)
collectionPhase
in class Simple
phaseId
- The unique id of the phase to perform.public final boolean collectionRequired(boolean spaceFull, Space space)
Plan
true
to trigger a collection.
collectionRequired
in class Plan
spaceFull
- Space request failed, must recover pages within 'space'.space
- TODO
true
if a collection is requested by the plan.public int getPagesUsed()
getPagesUsed
in class Plan
public int getCollectionReserve()
getCollectionReserve
in class Plan
public final int getPagesAvail()
Plan
getPagesAvail
in class Plan
public int sanityExpectedRC(ObjectReference object, int sanityRootRC)
Plan
true/false
relationship.
sanityExpectedRC
in class Plan
object
- The object to check.sanityRootRC
- The number of root references to the object.
protected void registerSpecializedMethods()
Plan
registerSpecializedMethods
in class Plan
public void fullyBooted()
fullyBooted
in class Plan
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |