|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmtk.policy.Space
org.mmtk.policy.immix.ImmixSpace
public final class ImmixSpace
Each instance of this class corresponds to one immix *space*. Each of the instance methods of this class may be called by any thread (i.e. synchronization must be explicit in any instance or class method). This contrasts with the SquishLocal, where instances correspond to *plan* instances and therefore to kernel threads. Thus unlike this class, synchronization is not necessary in the instance methods of SquishLocal.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.mmtk.policy.Space |
|---|
Space.SpaceVisitor |
| Field Summary | |
|---|---|
private Address |
allocBlockCursor
|
private Address |
allocBlockSentinel
|
private ChunkList |
chunkMap
|
private Defrag |
defrag
|
private boolean |
exhaustedReusableSpace
|
static BooleanCounter |
fullHeap
|
private Lock |
gcLock
|
private boolean |
inCollection
|
private int |
linesConsumed
|
private Word |
markState
Instance variables |
private Lock |
mutatorLock
|
private static short |
reusableMarkStateThreshold
Class variables |
static int |
TMPreusableBlockCount
|
static int |
TMPreusableLineCount
|
static int |
TMPreusedBlockCount
|
static int |
TMPreusedLineCount
|
| Fields inherited from class org.mmtk.policy.Space |
|---|
AVAILABLE_BYTES, AVAILABLE_END, AVAILABLE_PAGES, AVAILABLE_START, BYTES_IN_CHUNK, contiguous, descriptor, extent, HEAP_END, HEAP_START, immortal, lastDiscontiguousRegion, LOG_ADDRESS_SPACE, LOG_BYTES_IN_CHUNK, MAX_CHUNKS, MAX_SPACES, movable, PAGES_IN_CHUNK, pr, start |
| Constructor Summary | |
|---|---|
ImmixSpace(String name,
int pageBudget,
VMRequest vmRequest)
The caller specifies the region of virtual memory to be used for this space. |
|
| Method Summary | |
|---|---|
Address |
acquireReusableBlocks()
|
boolean |
copyNurseryIsLive(ObjectReference object)
Test the liveness of an object during copying sticky mark bits collection |
boolean |
fastIsLive(ObjectReference object)
Test the liveness of an object during defragmentation |
ObjectReference |
fastTraceObject(TransitiveClosure trace,
ObjectReference object)
Trace a reference to an object in the context of a non-moving collection. |
(package private) int |
getAvailableLines(int[] spillAvailHistogram)
Establish the number of recyclable lines lines available for allocation during defragmentation, populating the spillAvailHistogram, which buckets available lines according to the number of holes on the block on which the available lines reside. |
(package private) ChunkList |
getChunkMap()
|
(package private) Defrag |
getDefrag()
|
int |
getPagesAllocated()
Return the number of pages allocated since the last collection |
static short |
getReusuableMarkStateThreshold(boolean forDefrag)
Return the reusable mark state threshold, which determines how eagerly lines should be recycled (by default these values are set so that all lines are recycled). |
Address |
getSpace(boolean hot,
boolean copy,
int lineUseCount)
Return a pointer to a set of new usable blocks, or null if none are available. |
private int |
getUsableLinesInRegion(Address start,
Address end,
int[] spillAvailHistogram)
Return the number of lines usable for allocation during defragmentation in the address range specified by start and end. |
void |
globalRelease()
A new collection increment has completed. |
void |
growSpace(Address start,
Extent bytes,
boolean newChunk)
This hook is called by page resources each time a space grows. |
boolean |
inImmixCollection()
Return true if this space is currently being collected. |
boolean |
inImmixDefragCollection()
Return true if this space is currently being defraged. |
boolean |
isDefragSource(Address address)
|
private boolean |
isDefragSource(ObjectReference object)
|
boolean |
isLive(ObjectReference object)
Generic test of the liveness of an object |
static boolean |
isRecycleAllocChunkAligned(Address ptr)
Misc |
private void |
lock()
Acquire the appropriate lock depending on whether the context is GC or mutator. |
static void |
markLines(ObjectReference object)
Mark the line/s associated with a given object. |
ObjectReference |
nurseryTraceObject(TransitiveClosure trace,
ObjectReference object,
int allocator)
Trace a reference to an object during a nursery collection for a sticky mark bits implementation of immix. |
void |
postAlloc(ObjectReference object,
int bytes)
Perform any required post allocation initialization |
void |
postCopy(ObjectReference object,
int bytes,
boolean majorGC)
Perform any required post copy (i.e. in-GC allocation) initialization. |
void |
prepare(boolean majorGC)
Prepare for a new collection increment. |
void |
release(Address block)
Release a block. |
int |
releaseDiscontiguousChunks(Address chunk)
Release one or more contiguous chunks associated with a discontiguous space. |
void |
setCollectionKind(boolean emergencyCollection,
boolean collectWholeHeap,
int collectionAttempt,
int requiredAtStart,
boolean userTriggered)
Determine the collection kind. |
ObjectReference |
traceObject(TransitiveClosure trace,
ObjectReference object)
Trace a reference to an object. |
ObjectReference |
traceObject(TransitiveClosure trace,
ObjectReference object,
int allocator)
Trace a reference to an object. |
private ObjectReference |
traceObjectWithOpportunisticCopy(TransitiveClosure trace,
ObjectReference object,
int allocator,
boolean nurseryCollection)
Trace a reference to an object, forwarding the object if appropriate If the object is not already marked, mark the object and enqueue it for subsequent processing. |
private void |
traceObjectWithoutMoving(TransitiveClosure trace,
ObjectReference object)
Trace a reference to an object in the context of a non-moving collection. |
private void |
unlock()
Release the appropriate lock depending on whether the context is GC or mutator. |
boolean |
willNotMoveThisGC(Address address)
|
boolean |
willNotMoveThisGC(ObjectReference object)
|
boolean |
willNotMoveThisNurseryGC(ObjectReference object)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static short reusableMarkStateThreshold
public static BooleanCounter fullHeap
public static int TMPreusableLineCount
public static int TMPreusedLineCount
public static int TMPreusableBlockCount
public static int TMPreusedBlockCount
private Word markState
private boolean inCollection
private int linesConsumed
private Lock mutatorLock
private Lock gcLock
private Address allocBlockCursor
private Address allocBlockSentinel
private boolean exhaustedReusableSpace
private final ChunkList chunkMap
private final Defrag defrag
| Constructor Detail |
|---|
public ImmixSpace(String name,
int pageBudget,
VMRequest vmRequest)
name - The name of this space (used when printing error messages etc)pageBudget - The number of pages this space may consume before consulting the planvmRequest - The virtual memory request| Method Detail |
|---|
public void prepare(boolean majorGC)
public void globalRelease()
public void setCollectionKind(boolean emergencyCollection,
boolean collectWholeHeap,
int collectionAttempt,
int requiredAtStart,
boolean userTriggered)
emergencyCollection - Is this collection an emergency (last did not yield enough)?collectWholeHeap - Is this a whole heap collection?collectionAttempt - Which attempt is this to collect?requiredAtStart - How much space is required?userTriggered - Is this a user-triggered collection?public boolean inImmixCollection()
public boolean inImmixDefragCollection()
public int getPagesAllocated()
public static short getReusuableMarkStateThreshold(boolean forDefrag)
forDefrag - The query is the context of a defragmenting collection
public Address getSpace(boolean hot,
boolean copy,
int lineUseCount)
hot - True if the requesting context is for hot allocations (used for
allocations from high allocation volume sites).
public void growSpace(Address start,
Extent bytes,
boolean newChunk)
growSpace in class Spacestart - The start of the newly allocated spacebytes - The size of the newly allocated spacenewChunk - True if the new space encroached upon or started a new chunk or chunks.public Address acquireReusableBlocks()
public void release(Address block)
release in class Spaceblock - The address of the block to be releasedpublic int releaseDiscontiguousChunks(Address chunk)
releaseDiscontiguousChunks in class Spacechunk - THe address of the start of the contiguous chunk or chunks
public void postAlloc(ObjectReference object,
int bytes)
object - the object ref to the storage to be initialized
public void postCopy(ObjectReference object,
int bytes,
boolean majorGC)
object - the object ref to the storage to be initializedmajorGC - Is this copy happening during a major gc?
public ObjectReference traceObject(TransitiveClosure trace,
ObjectReference object,
int allocator)
trace - The trace performing the transitive closureobject - The object to be traced.allocator - The allocator to which any copying should be directed
public ObjectReference fastTraceObject(TransitiveClosure trace,
ObjectReference object)
trace - The trace performing the transitive closureobject - The object to be traced.
public ObjectReference nurseryTraceObject(TransitiveClosure trace,
ObjectReference object,
int allocator)
trace - The trace performing the transitive closureobject - The object to be traced.allocator - The allocator to which any copying should be directed
public ObjectReference traceObject(TransitiveClosure trace,
ObjectReference object)
traceObject in class Spacetrace - The trace performing the transitive closureobject - The object to be traced.
private void traceObjectWithoutMoving(TransitiveClosure trace,
ObjectReference object)
trace - The trace performing the transitive closureobject - The object to be traced.
private ObjectReference traceObjectWithOpportunisticCopy(TransitiveClosure trace,
ObjectReference object,
int allocator,
boolean nurseryCollection)
trace - The trace performing the transitive closureobject - The object to be traced.allocator - The allocator to which any copying should be directed
public static void markLines(ObjectReference object)
object - The object which is live and for which the associated lines
must be marked.int getAvailableLines(int[] spillAvailHistogram)
spillAvailHistogram - A histogram of availability to be populated
private int getUsableLinesInRegion(Address start,
Address end,
int[] spillAvailHistogram)
start - The start of the region to be checked for availabilityend - The end of the region to be checked for availabilityspillAvailHistogram - The histogram which will be populated
public boolean isLive(ObjectReference object)
isLive in class Spaceobject - The object in question
public boolean copyNurseryIsLive(ObjectReference object)
object - The object in question
public boolean fastIsLive(ObjectReference object)
object - The object in question
public boolean willNotMoveThisGC(ObjectReference object)
public boolean willNotMoveThisNurseryGC(ObjectReference object)
private boolean isDefragSource(ObjectReference object)
public boolean willNotMoveThisGC(Address address)
public boolean isDefragSource(Address address)
private void lock()
private void unlock()
public static boolean isRecycleAllocChunkAligned(Address ptr)
ChunkList getChunkMap()
Defrag getDefrag()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||