public abstract class Collection extends Object
Modifier and Type | Field and Description |
---|---|
static int |
EXTERNAL_GC_TRIGGER
Externally triggered garbage collection (eg call to System.gc())
|
static int |
INTERNAL_GC_TRIGGER
Internally triggered garbage collection.
|
static int |
INTERNAL_PHASE_GC_TRIGGER
Concurrent collection phase trigger.
|
static int |
RESOURCE_GC_TRIGGER
Resource triggered garbage collection.
|
static int |
TRIGGER_REASONS
The number of garbage collection trigger reasons.
|
protected static String[] |
triggerReasons
Short descriptions of the garbage collection trigger reasons.
|
static int |
UNKNOWN_GC_TRIGGER
An unknown GC trigger reason.
|
Constructor and Description |
---|
Collection() |
Modifier and Type | Method and Description |
---|---|
abstract void |
blockForGC()
Block for the garbage collector.
|
abstract int |
getActiveThreads() |
abstract int |
getDefaultThreads() |
abstract void |
outOfMemory()
Fail with an out of memory error.
|
abstract void |
prepareMutator(MutatorContext m)
Prepare a mutator for collection.
|
abstract void |
requestMutatorFlush()
Request each mutator flush remembered sets.
|
abstract void |
resumeAllMutators()
Resume all mutators blocked for GC.
|
abstract void |
spawnCollectorContext(CollectorContext context)
Spawns a thread to execute the supplied collector context.
|
abstract void |
stopAllMutators()
Stop all mutator threads.
|
public static final int UNKNOWN_GC_TRIGGER
public static final int INTERNAL_PHASE_GC_TRIGGER
public static final int EXTERNAL_GC_TRIGGER
public static final int RESOURCE_GC_TRIGGER
public static final int INTERNAL_GC_TRIGGER
public static final int TRIGGER_REASONS
protected static final String[] triggerReasons
public Collection()
public abstract void spawnCollectorContext(CollectorContext context)
context
- the context to executepublic abstract int getDefaultThreads()
public abstract int getActiveThreads()
public abstract void blockForGC()
public abstract void prepareMutator(MutatorContext m)
m
- the mutator to preparepublic abstract void requestMutatorFlush()
public abstract void stopAllMutators()
Fixpoint until there are no threads that we haven't blocked. Fixpoint is needed to catch the (unlikely) case that a thread spawns another thread while we are waiting.
public abstract void resumeAllMutators()
public abstract void outOfMemory()