private int scavenge(int obj) {
      int len = toSpace[obj];
    // Scan the fields in this object, using forward on
    // any pointer fields that we find to make sure the
    // objects that they refer to are copied into toSpace.

      for (int i = obj; i <= (obj+len); i++) {
          toSpace[i] = forward(toSpace[i]);
      }
      return len+1;
  }