[rvm-research] Scheduling a new Garbage Collection Phase

Nathan Ricci <[email protected]>
Newsgroups gmane.comp.java.jikes.rvm.devel
Message-ID <CALh3YaNXy4EQcmd+zyZX0SUG+aMoDq397HKNAdJJ-W9HFJ2JvA@mail.gmail.com>
    I'm implementing a garbage collector, called (for now) the "Control
Collector". I've based it on the mark sweep collector, and the classes are
called "GCControl", GCControlCollector, etc.

    As part of this, I'm trying to add a new collection phase, and I want
to divide some of the work between multiple threads. I seem to have
misunderstood how to do this, however, since in the
GCControlCollector#collectionPhase, I see the same worker ordinal enter the
new phase multiple times in a garbage collection.

     Do I even have the right idea? Is it the case that in a Collector, I
should only see a given phaseID once per worker ordinal (as returned by
ParallelCollector#parallelWorkerOrdinal()), and the worker ordinals have a
one-to-one correspondence to threads?

     Some code is below. Thanks for any help.

           --Nathan Ricci
              Tufts University

I create and schedule the phase in the plan:

public class GCControl extends MS {
...
  public static final short CONTROL_CLOSURE =
Phase.createSimple("GCControl.control_closure");
  protected static final short controlClosurePhase =
Phase.createComplex("GCControl.control_closure_complex",

null,

Phase.scheduleGlobal(CONTROL_CLOSURE),

Phase.scheduleCollector(CONTROL_CLOSURE));

public GCControl() {
    super();
  this.insertPhaseAfter(Phase.scheduleCollector(PREPARE),                i
                        Phase.scheduleComplex(controlPhase));

    this.insertPhaseAfter(Phase.scheduleCollector(CLOSURE),
Phase.scheduleComplex(controlClosurePhase));

       ...
}

Here is the collectionPhase method from the GCControlCollector:

public void collectionPhase(short phaseId, boolean primary) {

  if (phaseId == GCControl.CONTROL_CLOSURE) {
    Log.write("GCControlCollector: collectionPhase: CONTROL_CLOSURE phase:
ordinal ");
    Log.write(parallelWorkerOrdinal());
  ...
    return;
  }
  ...
  super.collectionPhase(phaseId, primary);
  }


I end up seeing from those log messages that the CONTROL_CLOSURE phase
comes up multiple times with the same worker ordinal, even within a garbage
collection.

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

_______________________________________________
Jikesrvm-researchers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jikesrvm-researchers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.