org.mmtk.utility.gcspy.drivers
Class TreadmillDriver

java.lang.Object
  extended by org.mmtk.utility.gcspy.drivers.AbstractDriver
      extended by org.mmtk.utility.gcspy.drivers.TreadmillDriver
Direct Known Subclasses:
GenLOSDriver

public class TreadmillDriver
extends AbstractDriver

This class implements a simple driver for the MMTk LargeObjectSpace.


Field Summary
protected  int allTileNum
           
private static boolean DEBUG
           
protected  Address maxAddr
           
protected  ShortStream objectsStream
           
protected  ShortStream refFromImmortalStream
           
protected  ShortStream rootsStream
           
protected  Subspace subspace
           
protected  int threshold
           
protected  int totalObjects
           
protected  int totalRefFromImmortal
           
protected  int totalRoots
           
protected  int totalUsedSpace
           
protected  IntStream usedSpaceStream
           
 
Fields inherited from class org.mmtk.utility.gcspy.drivers.AbstractDriver
blockSize, changed, control, CONTROL_BACKGROUND, CONTROL_LINK, CONTROL_SEPARATOR, CONTROL_UNUSED, CONTROL_USED, maxTileNum, mmtkSpace, myClass, name, server, serverSpace, streams
 
Constructor Summary
TreadmillDriver(ServerInterpreter server, String spaceName, LargeObjectSpace lospace, int blockSize, int threshold, boolean mainSpace)
          Create a new driver for this collector
 
Method Summary
private  ShortStream createObjectsStream()
           
private  ShortStream createRefFromImmortalStream()
           
private  ShortStream createRootsStream()
           
private  IntStream createUsedSpaceStream()
           
protected  String getDriverName()
          Get the name of this driver type.
 boolean handleReferenceFromImmortalSpace(Address addr)
          Handle a direct reference from the immortal space.
 boolean handleRoot(Address addr)
          Handle a root address
 void resetData()
          Reset the tile stats for all streams, including values used for summaries
 void resetRootsStream()
          Reset the roots Stream.
 void scan(Address addr)
          Update the tile statistics In this case, we are accounting for super-page objects, rather than simply for the objects they contain.
protected  void setupSummaries()
          Setup summaries part of the transmit method.
 void transmit(int event)
          Transmit the data if this event is of interest to the client
 
Methods inherited from class org.mmtk.utility.gcspy.drivers.AbstractDriver
addControl, addStream, controlIsBackground, controlIsSeparator, controlIsUnused, controlIsUsed, controlValues, countTileNum, countTileNum, createServerSpace, createSubspace, getControl, getMaxTileNum, getServerSpace, initControl, initControls, isConnected, maxObjectsPerBlock, scan, scan, scan, send, setControl, setRange, setRange, setSpaceInfo, setTilenames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

usedSpaceStream

protected IntStream usedSpaceStream

objectsStream

protected ShortStream objectsStream

rootsStream

protected ShortStream rootsStream

refFromImmortalStream

protected ShortStream refFromImmortalStream

subspace

protected Subspace subspace

allTileNum

protected int allTileNum

totalObjects

protected int totalObjects

totalUsedSpace

protected int totalUsedSpace

totalRoots

protected int totalRoots

totalRefFromImmortal

protected int totalRefFromImmortal

maxAddr

protected Address maxAddr

threshold

protected int threshold
Constructor Detail

TreadmillDriver

public TreadmillDriver(ServerInterpreter server,
                       String spaceName,
                       LargeObjectSpace lospace,
                       int blockSize,
                       int threshold,
                       boolean mainSpace)
Create a new driver for this collector

Parameters:
server - The name of the GCspy server that owns this space
spaceName - The name of this driver
lospace - the large object space for this allocator
blockSize - The tile size
threshold - the size threshold of the LOS
mainSpace - Is this the main space?
Method Detail

getDriverName

protected String getDriverName()
Description copied from class: AbstractDriver
Get the name of this driver type.

Specified by:
getDriverName in class AbstractDriver
Returns:
The name, "MMTk TreadmillDriver" for this driver.

createUsedSpaceStream

private IntStream createUsedSpaceStream()

createObjectsStream

private ShortStream createObjectsStream()

createRootsStream

private ShortStream createRootsStream()

createRefFromImmortalStream

private ShortStream createRefFromImmortalStream()

resetData

public void resetData()
Reset the tile stats for all streams, including values used for summaries

Overrides:
resetData in class AbstractDriver

scan

public void scan(Address addr)
Update the tile statistics In this case, we are accounting for super-page objects, rather than simply for the objects they contain.

Overrides:
scan in class AbstractDriver
Parameters:
addr - The address of the superpage

transmit

public void transmit(int event)
Transmit the data if this event is of interest to the client

Specified by:
transmit in class AbstractDriver
Parameters:
event - The event, either BEFORE_COLLECTION, SEMISPACE_COPIED or AFTER_COLLECTION

setupSummaries

protected void setupSummaries()
Setup summaries part of the transmit method.

Override this method to setup summaries of additional streams in subclasses.


handleRoot

public boolean handleRoot(Address addr)
Handle a root address

Parameters:
addr - Root Address
Returns:
true if the given Address is in this subspace.

resetRootsStream

public void resetRootsStream()
Reset the roots Stream.
The roots Stream has to be reset separately because we do not gather data in the usual way using scan().


handleReferenceFromImmortalSpace

public boolean handleReferenceFromImmortalSpace(Address addr)
Handle a direct reference from the immortal space.

Overrides:
handleReferenceFromImmortalSpace in class AbstractDriver
Parameters:
addr - The Address
Returns:
true if the given Address is in this subspace.