|
|||||||||||
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.generational.Gen
public abstract class Gen
This abstract class implements the core functionality of generic
two-generation copying collectors. 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 also Plan.java for general comments on local vs global plan classes.
Fields inherited from class org.mmtk.plan.StopTheWorld |
---|
postSanityPhase, preSanityPhase |
Constructor Summary | |
---|---|
Gen()
|
Method Summary | |
---|---|
protected abstract 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. |
boolean |
collectionRequired(boolean spaceFull,
Space space)
This method controls the triggering of a GC. |
protected boolean |
copyMature()
|
void |
forceFullHeapCollection()
Force the next collection to be full heap. |
void |
fullyBooted()
|
int |
getCollectionReserve()
Return the number of pages reserved for collection. |
abstract int |
getMaturePhysicalPagesAvail()
Return the number of pages available for allocation into the mature space. |
int |
getPagesAvail()
Return the number of pages available for allocation, assuming all future allocation is to the nursery. |
int |
getPagesUsed()
Return the number of pages reserved for use given the pending allocation. |
(package private) static boolean |
inNursery(Address addr)
Return true if the address resides within the nursery |
(package private) static boolean |
inNursery(ObjectReference obj)
Return true if the object resides within the nursery |
boolean |
isCurrentGCNursery()
|
boolean |
lastCollectionFullHeap()
|
void |
printPreStats()
Print pre-collection statistics. |
protected void |
registerSpecializedMethods()
Register specialized methods. |
protected boolean |
requiresFullHeapCollection()
Determine if this GC should be a full heap collection. |
int |
sanityExpectedRC(ObjectReference object,
int sanityRootRC)
Return the expected reference count. |
boolean |
traceFullHeap()
|
private boolean |
virtualMemoryExhausted()
Independent of how many pages remain in the page budget (a function of heap size), we must ensure we never exhaust virtual memory. |
boolean |
willNeverMove(ObjectReference object)
Can this object ever move. |
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 float DEFAULT_PRETENURE_THRESHOLD_FRACTION
protected static final float SURVIVAL_ESTIMATE
protected static final float MATURE_FRACTION
private static final float WORST_CASE_COPY_EXPANSION
public static final boolean IGNORE_REMSETS
public static final boolean USE_NON_HEAP_OBJECT_REFERENCE_WRITE_BARRIER
public static final boolean USE_OBJECT_BARRIER_FOR_AASTORE
public static final boolean USE_OBJECT_BARRIER_FOR_PUTFIELD
public static final boolean USE_OBJECT_BARRIER
protected static final float NURSERY_VM_FRACTION
static final boolean USE_DISCONTIGUOUS_NURSERY
public static final int ALLOC_NURSERY
public static final int ALLOC_MATURE
public static final int ALLOC_MATURE_MINORGC
public static final int ALLOC_MATURE_MAJORGC
public static final int SCAN_NURSERY
public static final int SCAN_MATURE
protected static final BooleanCounter fullHeap
private static final Timer fullHeapTime
protected static final EventCounter wbFast
protected static final EventCounter wbSlow
public static final SizeCounter nurseryMark
public static final SizeCounter nurseryCons
private static final VMRequest vmRequest
public static final CopySpace nurserySpace
public static final int NURSERY
private static final Address NURSERY_START
public boolean gcFullHeap
public boolean nextGCFullHeap
public final Trace nurseryTrace
public final SharedDeque modbufPool
public final SharedDeque remsetPool
public final SharedDeque arrayRemsetPool
Constructor Detail |
---|
public Gen()
Method Detail |
---|
public void forceFullHeapCollection()
forceFullHeapCollection
in class Plan
public void collectionPhase(short phaseId)
Simple
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.protected boolean requiresFullHeapCollection()
true
is this GC should be a full heap collection.private boolean virtualMemoryExhausted()
true
if the nursery has grown to the extent that it may not be
able to be copied into the mature space.public int getPagesUsed()
getPagesUsed
in class Plan
public int getPagesAvail()
getPagesAvail
in class Plan
public int getCollectionReserve()
getCollectionReserve
in class Plan
public abstract int getMaturePhysicalPagesAvail()
static boolean inNursery(Address addr)
true
if the address resides within the nursery
addr
- The object to be tested
true
if the address resides within the nurserystatic boolean inNursery(ObjectReference obj)
true
if the object resides within the nursery
obj
- The object to be tested
true
if the object resides within the nurseryprotected boolean copyMature()
public void printPreStats()
printPreStats
in class Plan
protected abstract Space activeMatureSpace()
Gen
.public final boolean traceFullHeap()
true
if we should trace the whole heap during collection. True if
we're ignoring remsets or if we're doing a full heap GC.public final boolean isCurrentGCNursery()
isCurrentGCNursery
in class Plan
public final boolean lastCollectionFullHeap()
lastCollectionFullHeap
in class Plan
public boolean willNeverMove(ObjectReference object)
Plan
willNeverMove
in class Plan
object
- The object in question
true
if it is not possible that the object will ever move.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 |