size_t VirtualSpace::actual_committed_size() const {
  // Special VirtualSpaces commit all reserved space up front.
  if (special()) {
    return reserved_size();
  }

  size_t committed_low    = pointer_delta(_lower_high,  _low_boundary,         sizeof(char));
  size_t committed_middle = pointer_delta(_middle_high, _lower_high_boundary,  sizeof(char));
  size_t committed_high   = pointer_delta(_upper_high,  _middle_high_boundary, sizeof(char));

#ifdef ASSERT
  size_t lower  = pointer_delta(_lower_high_boundary,  _low_boundary,         sizeof(char));
  size_t middle = pointer_delta(_middle_high_boundary, _lower_high_boundary,  sizeof(char));
  size_t upper  = pointer_delta(_upper_high_boundary,  _middle_high_boundary, sizeof(char));

  if (committed_high > 0) {
    assert(committed_low == lower, "Must be");
    assert(committed_middle == middle, "Must be");
  }

  if (committed_middle > 0) {
    assert(committed_low == lower, "Must be");
  }
  if (committed_middle < middle) {
    assert(committed_high == 0, "Must be");
  }

  if (committed_low < lower) {
    assert(committed_high == 0, "Must be");
    assert(committed_middle == 0, "Must be");
  }
#endif

  return committed_low + committed_middle + committed_high;
}
void PSVirtualSpace::release() {
    DEBUG_ONLY(PSVirtualSpaceVerifier this_verifier(this));
    if (reserved_low_addr() != NULL) {
        os::release_memory(reserved_low_addr(),reserved_size());
    }
    _reserved_low_addr = _reserved_high_addr = NULL;
    _committed_low_addr = _committed_high_addr = NULL;
}
void G1PageBasedVirtualSpace::print_on(outputStream* out) {
  out->print   ("Virtual space:");
  if (special()) out->print(" (pinned in memory)");
  out->cr();
  out->print_cr(" - committed: " SIZE_FORMAT, committed_size());
  out->print_cr(" - reserved:  " SIZE_FORMAT, reserved_size());
  out->print_cr(" - [low_b, high_b]: [" INTPTR_FORMAT ", " INTPTR_FORMAT "]",  p2i(_low_boundary), p2i(_high_boundary));
}
Ejemplo n.º 4
0
void VirtualSpace::print() {
  tty->print   ("Virtual space:");
  if (special()) tty->print(" (pinned in memory)");
  tty->cr();
  tty->print_cr(" - committed: " SIZE_FORMAT, committed_size());
  tty->print_cr(" - reserved:  " SIZE_FORMAT, reserved_size());
  tty->print_cr(" - [low, high]:     [" INTPTR_FORMAT ", " INTPTR_FORMAT "]",  low(), high());
  tty->print_cr(" - [low_b, high_b]: [" INTPTR_FORMAT ", " INTPTR_FORMAT "]",  low_boundary(), high_boundary());
}
Ejemplo n.º 5
0
void PSVirtualSpace::print() const {
  gclog_or_tty->print_cr("virtual space [" PTR_FORMAT "]:  alignment="
			 SIZE_FORMAT "K grows %s",
			 this, alignment() / K, grows_up() ? "up" : "down");
  gclog_or_tty->print_cr("    reserved=" SIZE_FORMAT "K"
			 " [" PTR_FORMAT "," PTR_FORMAT "]"
			 " committed=" SIZE_FORMAT "K"
			 " [" PTR_FORMAT "," PTR_FORMAT "]",
			 reserved_size() / K,
			 reserved_low_addr(), reserved_high_addr(),
			 committed_size() / K,
			 committed_low_addr(), committed_high_addr());
}
Ejemplo n.º 6
0
void PSVirtualSpace::print() const {
  gclog_or_tty->print_cr("virtual space [" PTR_FORMAT "]:  alignment="
                         SIZE_FORMAT "K grows %s%s",
                         p2i(this), alignment() / K, grows_up() ? "up" : "down",
                         special() ? " (pinned in memory)" : "");
  gclog_or_tty->print_cr("    reserved=" SIZE_FORMAT "K"
                         " [" PTR_FORMAT "," PTR_FORMAT "]"
                         " committed=" SIZE_FORMAT "K"
                         " [" PTR_FORMAT "," PTR_FORMAT "]",
                         reserved_size() / K,
                         p2i(reserved_low_addr()), p2i(reserved_high_addr()),
                         committed_size() / K,
                         p2i(committed_low_addr()), p2i(committed_high_addr()));
}
Ejemplo n.º 7
0
size_t G1PageBasedVirtualSpace::uncommitted_size()  const {
  return reserved_size() - committed_size();
}
Ejemplo n.º 8
0
inline size_t PSVirtualSpace::uncommitted_size() const {
  return reserved_size() - committed_size();
}