|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GarbageCollector
This interface represents the Garbage Collector of the JVM. (The GarbageCollection subsystem.)
Method Summary | |
---|---|
void |
addFinalizationListener(FinalizationListener listener)
Add listener to be notified whenever an Object has been finalized. |
void |
addFinalizationListener(FinalizationListener listener,
boolean onlyFailed)
Add listener to be notified whenever an Object has been finalized. |
void |
addGarbageCollectionListener(GarbageCollectionListener listener)
Adds a listener to be notified whenever a Garbage Collection run has been performed. |
void |
addGarbageCollectionStrategyChangeListener(GarbageCollectionStrategyChangeListener listener)
Adds a listener for the strategy change event (@see GarbageCollectionStrategyChangeEvent). |
java.lang.String |
getDescription()
A short description of the GC algorithm in use. |
java.util.Collection |
getGarbageCollectionStrategies()
Returns a collection of currently available GarbageCollectionStrategies (@see GarbageCollectionStrategy). |
GarbageCollectionStrategy |
getGarbageCollectionStrategy()
Returns the strategy currently being employed by the GarbageCollector. |
long |
getLastGCEnd()
Returns the time the last Garbage Collection run started. |
long |
getLastGCStart()
Returns the time the last Garbage Collection run started. |
long |
getMaxPauseTimeTarget()
|
long |
getMinPauseTimeTarget()
|
long |
getNurserySize()
Returns the size of the nursery/youngspace in bytes. |
long |
getPauseTimeTarget()
|
long |
getTotalGarbageCollectionCount()
Returns the total number of collection runs performed so far. |
long |
getTotalGarbageCollectionTime()
Returns the total time spent Garabage Collecting so far. |
boolean |
hasCompaction()
Returns true if this Garbage Collector compacts the heap. |
boolean |
isConcurrent()
Returns true if this Garbage Collector at some point collects garbage concurrently, i.e. in a separate thread running concurrently with the other threads. |
boolean |
isDynamic()
Returns true if the GC system is running in a dynamic mode, i.e. a mode that allows the strategy to change. |
boolean |
isGenerational()
Returns true if this memory model at some point uses a nursery/ young-space. |
boolean |
isIncremental()
Returns true if this Garbage Collector collects garbage incrementally (in small steps, train algorithm or similar). |
boolean |
isParallel()
Returns true if this Garbage Collector at some point runs in parallel on several processors when collecting garbage. |
boolean |
isSelfOptimizing()
Returns true if the GC system is running in a mode that will automatically choose GarbageCollectionStrategy for you. |
void |
removeFinalizationListener(FinalizationListener listener)
Removes the specified listener. |
void |
removeGarbageCollectionListener(GarbageCollectionListener listener)
Removes the specified GarbageCollectionListener. |
void |
removeGarbageCollectionStrategyChangeListener(GarbageCollectionStrategyChangeListener listener)
Removes a strategy change listener (@see GarbageCollectionStrategyChangeEvent). |
void |
setNurserySize(long nurserySize)
Sets the nursery size. |
void |
setPauseTimeTarget(long target)
Sets the pausetime target, i.e. the memory system will try its best to make sure the longest pausetime never exceeds this value. |
void |
suggestGarbageCollectionStrategy(GarbageCollectionStrategy strategy)
Suggests a static garbage collector strategy to the system. |
Method Detail |
---|
java.lang.String getDescription()
getDescription
in interface Describable
Describable.getDescription()
boolean isGenerational() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this JVM.boolean hasCompaction() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this JVM.boolean isIncremental() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this JVM.boolean isConcurrent() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this JVM.boolean isParallel() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this JVM.long getTotalGarbageCollectionCount() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this JVM.long getLastGCStart() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this JVM.long getLastGCEnd() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this JVM.long getTotalGarbageCollectionTime() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this JVM.long getNurserySize() throws NotAvailableException
NotAvailableException
- if this functionality isn't available in
this Garbage Collector or JVM.void setNurserySize(long nurserySize) throws NotAvailableException
nurserySize
- the new size of the nursery.
NotAvailableException
- if the functionality isn't supported
in this JVM, or if the current GarbageCollectionStrategy in use lacks
a nursery (i.e. isGenerational() == false).void addGarbageCollectionListener(GarbageCollectionListener listener) throws NotAvailableException
listener
- the listener to use.
NotAvailableException
- if this functionality isn't available in
this JVM.void removeGarbageCollectionListener(GarbageCollectionListener listener) throws NotAvailableException
listener
- the listener to remove.
NotAvailableException
- if this functionality isn't available in
this JVM.void addFinalizationListener(FinalizationListener listener) throws NotAvailableException
listener
- the listener to receive events whenever an object is
finalized.
NotAvailableException
- if this functionality isn't available in
this JVM.void addFinalizationListener(FinalizationListener listener, boolean onlyFailed) throws NotAvailableException
listener
- the listener to add.onlyFailed
- whether to only send events for finalizers that fail
(i.e. throw an exception).
NotAvailableException
- if this functionality isn't available in
this JVM.void removeFinalizationListener(FinalizationListener listener) throws NotAvailableException
listener
- the listener to remove.
NotAvailableException
- if this functionality isn't available in
this JVM.java.util.Collection getGarbageCollectionStrategies() throws NotAvailableException
NotAvailableException
- if not supported
by the VM.GarbageCollectionStrategy getGarbageCollectionStrategy() throws NotAvailableException
NotAvailableException
void suggestGarbageCollectionStrategy(GarbageCollectionStrategy strategy) throws NotAvailableException
Note that:
strategy
- the suggested garbage collector state.
NotAvailableException
- if this functionality isn't available
in this Garbage Collector or JVM.boolean isDynamic() throws NotAvailableException
NotAvailableException
- if this functionality isn't available
in this Garbage Collector or JVM.boolean isSelfOptimizing() throws NotAvailableException
NotAvailableException
- if this functionality isn't available
in this Garbage Collector or JVM.void addGarbageCollectionStrategyChangeListener(GarbageCollectionStrategyChangeListener listener) throws NotAvailableException
listener
- the listener to add.
NotAvailableException
- if this functionality isn't available
in this Garbage Collector or JVM.void removeGarbageCollectionStrategyChangeListener(GarbageCollectionStrategyChangeListener listener) throws NotAvailableException
listener
- the listener to remove.
NotAvailableException
- if this functionality isn't available
in this Garbage Collector or JVM.void setPauseTimeTarget(long target) throws NotAvailableException
target
- the target pause time in ms.
NotAvailableException
- if the current garbage collector isn't (deterministic | gcprio:paustime).long getPauseTimeTarget() throws NotAvailableException
NotAvailableException
- if the current garbage collector isn't (deterministic | gcprio:paustime).long getMinPauseTimeTarget()
long getMaxPauseTimeTarget()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |