JanosVM v0.6.0 Java API

## edu.utah.janosvm.resources
Class GCPolicy

    java.lang.Object
      |
      +--edu.utah.janosvm.resources.GCPolicy

public class GCPolicy
extends java.lang.Object

Base class for objects that implement a specific policy for the GC.

Author:
  Tim Stack, Utah Janos Team

Field Summary
`protected long` `max` The maximum amount of memory available to this GC.

Constructor Summary
`GCPolicy(long max)` Construct a GCPolicy object with the given values.

Method Summary
`static GCPolicy` `currentPolicy()`
`boolean` `enable()` The enable function is called just before the team is finished being initialized, so you have a chance to do something, like start the GC and finalizer threads.
`long` `initialTrigger()`
`long` `newTrigger(long used, long freed)` This function is called after a GC happened to determine the next time to do a GC.
`boolean` `startThreads()`
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### max

    protected final long max

  The maximum amount of memory available to this GC.

Constructor Detail

### GCPolicy

    public GCPolicy(long max)

  Construct a GCPolicy object with the given values.
  Parameters:
    `max` - The maximum amount of memory available to the GC.

Method Detail

### startThreads

    public boolean startThreads()

  Returns:
    true if the GC was successful in starting all of its threads.

### enable

    public boolean enable()

  The enable function is called just before the team is finished being initialized, so you have a chance to do something, like start the GC and finalizer threads.
  Returns:
    True if the enable was successful, false otherwise.

### initialTrigger

    public long initialTrigger()

  Returns:
    The initial number that should be used when trying to decide whether to do a GC or allocate more memory from the OS.

### newTrigger

    public long newTrigger(long used,
                           long freed)

  This function is called after a GC happened to determine the next time to do a GC. The default is 1 1/3 times the current amount used.
  Parameters:
    `used` - The current amount of memory used.
    `freed` - (Bogus at this time I think).
  Returns:
    The new trigger for the GC.

### toString

    public java.lang.String toString()

  Overrides:
    toString in class java.lang.Object

### currentPolicy

    public static GCPolicy currentPolicy()

  Returns:
    The GCPolicy for the current team.

JanosVM v0.6.0 Java API

This documentation is Copyright (C) 2000-2002 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Mar 17, 2002