overall_stats.reset();
  private InstanceStats[] updateNow(boolean returnEntities) {    // prune out the freed objects, create a list of entries    synchronized (lock) {      if (objs == null) {        if (returnEntities) {          return new InstanceStats[0];        } else {          return  null;        }      }      // First, clear some stats      if (agents != null) {         agents.reset();      }      InstanceStats[] ret = null;      int ret_size = 0;      if (returnEntities) {        ret = new InstanceStats[objs.size()];      }      objs.startIterator();      while (true) {        InstanceStats is = objs.next();        if (is == null) {          break;        }        if (returnEntities) {          if (ret_size >= ret.length) {            InstanceStats[] old = ret;            ret = new InstanceStats[2 * ret.length];            System.arraycopy(old, 0, ret, 0, ret_size);          }          ret[ret_size++] = is;        }        // update the entry        updateInstanceStats(is);       }      if (returnEntities &&           (ret_size != ret.length)) {        // trim to size        InstanceStats[] old = ret;        ret = new InstanceStats[ret_size];        System.arraycopy(            old, 0, ret, 0, ret_size);      }      return ret;    }  }