|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.policy.MarkCompactCollector
public final class MarkCompactCollector
This class implements unsynchronized (local) per-collector-thread elements of a sliding mark-compact collector.
Specifically, this class provides the methods that
Each collector thread maintains a private list of the pages that it compacts. If it runs out of work during the calculateForwardingPointers pass, it requests a new region from the global MarkCompactSpace. Regions compacted by a collector remain local to the collector.
MarkCompactSpace
,
MarkCompactLocal
Nested Class Summary | |
---|---|
private static class |
MarkCompactCollector.FromCursor
Subclass for the read-only cursor that leads the scan of regions. |
private static class |
MarkCompactCollector.RegionCursor
Both the 'compact' and 'calculate' phases can be thought of as sweeping a pair of cursors across a linked list of regions. |
private static class |
MarkCompactCollector.ToCursor
Subclass for the read-only cursor that follows the 'from' cursor, writing or calculating the position of copied objects |
Field Summary | |
---|---|
private MarkCompactCollector.FromCursor |
fromCursor
|
private Address |
regions
This collector's work list |
private MarkCompactSpace |
space
|
private MarkCompactCollector.ToCursor |
toCursor
|
(package private) static boolean |
VERBOSE
|
(package private) static boolean |
VERY_VERBOSE
|
Constructor Summary | |
---|---|
MarkCompactCollector(MarkCompactSpace space)
Constructor |
Method Summary | |
---|---|
void |
calculateForwardingPointers()
Perform a linear scan through the objects allocated by this bump pointer, calculating where each live object will be post collection. |
void |
compact()
Perform the compacting phase of the collection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final boolean VERBOSE
static final boolean VERY_VERBOSE
private final MarkCompactSpace space
private Address regions
private final MarkCompactCollector.FromCursor fromCursor
private final MarkCompactCollector.ToCursor toCursor
Constructor Detail |
---|
public MarkCompactCollector(MarkCompactSpace space)
space
- The space to bump point into.Method Detail |
---|
public void calculateForwardingPointers()
We maintain two cursors, fromCursor
and toCursor
, and simulate
copying live objects from the former to the latter. Initially, the cursors
point to the first region in this collector's local list, and increment in
lockstep until the first dead object is encountered. After that, the to cursor
trails the from cursor.
The outer loop advances the 'from' pointer
public void compact()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |