1098 }
1099
1100 assert(total_invocations() >= _maximum_compaction_gc_num, "sanity");
1101 const size_t gcs_since_max = total_invocations() - _maximum_compaction_gc_num;
1102 const bool interval_ended = gcs_since_max > HeapMaximumCompactionInterval;
1103 if (maximum_compaction || cp == end_cp || interval_ended) {
1104 _maximum_compaction_gc_num = total_invocations();
1105 return sd.region_to_addr(cp);
1106 }
1107
1108 HeapWord* const new_top = _space_info[id].new_top();
1109 const size_t space_live = pointer_delta(new_top, space->bottom());
1110 const size_t space_used = space->used_in_words();
1111 const size_t space_capacity = space->capacity_in_words();
1112
1113 const double cur_density = double(space_live) / space_capacity;
1114 const double deadwood_density =
1115 (1.0 - cur_density) * (1.0 - cur_density) * cur_density * cur_density;
1116 const size_t deadwood_goal = size_t(space_capacity * deadwood_density);
1117
1118 if (TraceParallelOldGCDensePrefix) {
1119 tty->print_cr("cur_dens=%5.3f dw_dens=%5.3f dw_goal=" SIZE_FORMAT,
1120 cur_density, deadwood_density, deadwood_goal);
1121 tty->print_cr("space_live=" SIZE_FORMAT " " "space_used=" SIZE_FORMAT " "
1122 "space_cap=" SIZE_FORMAT,
1123 space_live, space_used,
1124 space_capacity);
1125 }
1126
1127 // XXX - Use binary search?
1128 HeapWord* dense_prefix = sd.region_to_addr(cp);
1129 const RegionData* full_cp = cp;
1130 const RegionData* const top_cp = sd.addr_to_region_ptr(space->top() - 1);
1131 while (cp < end_cp) {
1132 HeapWord* region_destination = cp->destination();
1133 const size_t cur_deadwood = pointer_delta(dense_prefix, region_destination);
1134 if (TraceParallelOldGCDensePrefix && Verbose) {
1135 tty->print_cr("c#=" SIZE_FORMAT_W(4) " dst=" PTR_FORMAT " "
1136 "dp=" PTR_FORMAT " " "cdw=" SIZE_FORMAT_W(8),
1137 sd.region(cp), p2i(region_destination),
1138 p2i(dense_prefix), cur_deadwood);
1139 }
1140
1141 if (cur_deadwood >= deadwood_goal) {
1142 // Found the region that has the correct amount of deadwood to the left.
1143 // This typically occurs after crossing a fairly sparse set of regions, so
1144 // iterate backwards over those sparse regions, looking for the region
1145 // that has the lowest density of live objects 'to the right.'
1146 size_t space_to_left = sd.region(cp) * region_size;
1147 size_t live_to_left = space_to_left - cur_deadwood;
1148 size_t space_to_right = space_capacity - space_to_left;
1149 size_t live_to_right = space_live - live_to_left;
1150 double density_to_right = double(live_to_right) / space_to_right;
1151 while (cp > full_cp) {
1152 --cp;
1153 const size_t prev_region_live_to_right = live_to_right -
1154 cp->data_size();
1155 const size_t prev_region_space_to_right = space_to_right + region_size;
1156 double prev_region_density_to_right =
1157 double(prev_region_live_to_right) / prev_region_space_to_right;
1158 if (density_to_right <= prev_region_density_to_right) {
1159 return dense_prefix;
1160 }
1161 if (TraceParallelOldGCDensePrefix && Verbose) {
1162 tty->print_cr("backing up from c=" SIZE_FORMAT_W(4) " d2r=%10.8f "
1163 "pc_d2r=%10.8f", sd.region(cp), density_to_right,
1164 prev_region_density_to_right);
1165 }
1166 dense_prefix -= region_size;
1167 live_to_right = prev_region_live_to_right;
1168 space_to_right = prev_region_space_to_right;
1169 density_to_right = prev_region_density_to_right;
1170 }
1171 return dense_prefix;
1172 }
1173
1174 dense_prefix += region_size;
1175 ++cp;
1176 }
1177
1178 return dense_prefix;
1179 }
1180
1181 #ifndef PRODUCT
1182 void PSParallelCompact::print_dense_prefix_stats(const char* const algorithm,
1183 const SpaceId id,
1184 const bool maximum_compaction,
1185 HeapWord* const addr)
1186 {
1187 const size_t region_idx = summary_data().addr_to_region_idx(addr);
1188 RegionData* const cp = summary_data().region(region_idx);
1189 const MutableSpace* const space = _space_info[id].space();
1190 HeapWord* const new_top = _space_info[id].new_top();
1191
1192 const size_t space_live = pointer_delta(new_top, space->bottom());
1193 const size_t dead_to_left = pointer_delta(addr, cp->destination());
1194 const size_t space_cap = space->capacity_in_words();
1195 const double dead_to_left_pct = double(dead_to_left) / space_cap;
1196 const size_t live_to_right = new_top - cp->destination();
1197 const size_t dead_to_right = space->top() - addr - live_to_right;
1198
1199 tty->print_cr("%s=" PTR_FORMAT " dpc=" SIZE_FORMAT_W(5) " "
1200 "spl=" SIZE_FORMAT " "
1201 "d2l=" SIZE_FORMAT " d2l%%=%6.4f "
1202 "d2r=" SIZE_FORMAT " l2r=" SIZE_FORMAT
1203 " ratio=%10.8f",
1204 algorithm, p2i(addr), region_idx,
1205 space_live,
1206 dead_to_left, dead_to_left_pct,
1207 dead_to_right, live_to_right,
1208 double(dead_to_right) / live_to_right);
1209 }
1210 #endif // #ifndef PRODUCT
1211
1212 // Return a fraction indicating how much of the generation can be treated as
1213 // "dead wood" (i.e., not reclaimed). The function uses a normal distribution
1214 // based on the density of live objects in the generation to determine a limit,
1215 // which is then adjusted so the return value is min_percent when the density is
1216 // 1.
1217 //
1218 // The following table shows some return values for a different values of the
1219 // standard deviation (ParallelOldDeadWoodLimiterStdDev); the mean is 0.5 and
1220 // min_percent is 1.
1221 //
1222 // fraction allowed as dead wood
1223 // -----------------------------------------------------------------
1396 assert(total_invocations() >= _maximum_compaction_gc_num, "sanity");
1397 const size_t gcs_since_max = total_invocations() - _maximum_compaction_gc_num;
1398 const bool interval_ended = gcs_since_max > HeapMaximumCompactionInterval ||
1399 total_invocations() == HeapFirstMaximumCompactionCount;
1400 if (maximum_compaction || full_cp == top_cp || interval_ended) {
1401 _maximum_compaction_gc_num = total_invocations();
1402 return sd.region_to_addr(full_cp);
1403 }
1404
1405 const size_t space_live = pointer_delta(new_top, bottom);
1406 const size_t space_used = space->used_in_words();
1407 const size_t space_capacity = space->capacity_in_words();
1408
1409 const double density = double(space_live) / double(space_capacity);
1410 const size_t min_percent_free = MarkSweepDeadRatio;
1411 const double limiter = dead_wood_limiter(density, min_percent_free);
1412 const size_t dead_wood_max = space_used - space_live;
1413 const size_t dead_wood_limit = MIN2(size_t(space_capacity * limiter),
1414 dead_wood_max);
1415
1416 if (TraceParallelOldGCDensePrefix) {
1417 tty->print_cr("space_live=" SIZE_FORMAT " " "space_used=" SIZE_FORMAT " "
1418 "space_cap=" SIZE_FORMAT,
1419 space_live, space_used,
1420 space_capacity);
1421 tty->print_cr("dead_wood_limiter(%6.4f, " SIZE_FORMAT ")=%6.4f "
1422 "dead_wood_max=" SIZE_FORMAT " dead_wood_limit=" SIZE_FORMAT,
1423 density, min_percent_free, limiter,
1424 dead_wood_max, dead_wood_limit);
1425 }
1426
1427 // Locate the region with the desired amount of dead space to the left.
1428 const RegionData* const limit_cp =
1429 dead_wood_limit_region(full_cp, top_cp, dead_wood_limit);
1430
1431 // Scan from the first region with dead space to the limit region and find the
1432 // one with the best (largest) reclaimed ratio.
1433 double best_ratio = 0.0;
1434 const RegionData* best_cp = full_cp;
1435 for (const RegionData* cp = full_cp; cp < limit_cp; ++cp) {
1436 double tmp_ratio = reclaimed_ratio(cp, bottom, top, new_top);
1437 if (tmp_ratio > best_ratio) {
1438 best_cp = cp;
1439 best_ratio = tmp_ratio;
1440 }
1441 }
1442
1443 return sd.region_to_addr(best_cp);
1444 }
1445
1519 _mark_bitmap.mark_obj(obj_beg, obj_len);
1520 _summary_data.add_obj(obj_beg, obj_len);
1521 assert(start_array(id) != NULL, "sanity");
1522 start_array(id)->allocate_block(obj_beg);
1523 }
1524 }
1525
1526 void
1527 PSParallelCompact::summarize_space(SpaceId id, bool maximum_compaction)
1528 {
1529 assert(id < last_space_id, "id out of range");
1530 assert(_space_info[id].dense_prefix() == _space_info[id].space()->bottom(),
1531 "should have been reset in summarize_spaces_quick()");
1532
1533 const MutableSpace* space = _space_info[id].space();
1534 if (_space_info[id].new_top() != space->bottom()) {
1535 HeapWord* dense_prefix_end = compute_dense_prefix(id, maximum_compaction);
1536 _space_info[id].set_dense_prefix(dense_prefix_end);
1537
1538 #ifndef PRODUCT
1539 if (TraceParallelOldGCDensePrefix) {
1540 print_dense_prefix_stats("ratio", id, maximum_compaction,
1541 dense_prefix_end);
1542 HeapWord* addr = compute_dense_prefix_via_density(id, maximum_compaction);
1543 print_dense_prefix_stats("density", id, maximum_compaction, addr);
1544 }
1545 #endif // #ifndef PRODUCT
1546
1547 // Recompute the summary data, taking into account the dense prefix. If
1548 // every last byte will be reclaimed, then the existing summary data which
1549 // compacts everything can be left in place.
1550 if (!maximum_compaction && dense_prefix_end != space->bottom()) {
1551 // If dead space crosses the dense prefix boundary, it is (at least
1552 // partially) filled with a dummy object, marked live and added to the
1553 // summary data. This simplifies the copy/update phase and must be done
1554 // before the final locations of objects are determined, to prevent
1555 // leaving a fragment of dead space that is too small to fill.
1556 fill_dense_prefix_end(id);
1557
1558 // Compute the destination of each Region, and thus each object.
1559 _summary_data.summarize_dense_prefix(space->bottom(), dense_prefix_end);
1594 SIZE_FORMAT "-" SIZE_FORMAT " "
1595 "dst=" PTR_FORMAT "-" PTR_FORMAT " "
1596 SIZE_FORMAT "-" SIZE_FORMAT,
1597 src_space_id, space_names[src_space_id],
1598 dst_space_id, space_names[dst_space_id],
1599 p2i(src_beg), p2i(src_end),
1600 _summary_data.addr_to_region_idx(src_beg),
1601 _summary_data.addr_to_region_idx(src_end),
1602 p2i(dst_beg), p2i(dst_end),
1603 _summary_data.addr_to_region_idx(dst_beg),
1604 _summary_data.addr_to_region_idx(dst_end));
1605 }
1606 #endif // #ifndef PRODUCT
1607
1608 void PSParallelCompact::summary_phase(ParCompactionManager* cm,
1609 bool maximum_compaction)
1610 {
1611 GCTraceTime(Info, gc, phases) tm("Summary Phase", &_gc_timer);
1612
1613 #ifdef ASSERT
1614 if (TraceParallelOldGCMarkingPhase) {
1615 tty->print_cr("add_obj_count=" SIZE_FORMAT " "
1616 "add_obj_bytes=" SIZE_FORMAT,
1617 add_obj_count, add_obj_size * HeapWordSize);
1618 tty->print_cr("mark_bitmap_count=" SIZE_FORMAT " "
1619 "mark_bitmap_bytes=" SIZE_FORMAT,
1620 mark_bitmap_count, mark_bitmap_size * HeapWordSize);
1621 }
1622 #endif // #ifdef ASSERT
1623
1624 // Quick summarization of each space into itself, to see how much is live.
1625 summarize_spaces_quick();
1626
1627 log_develop_trace(gc, compaction)("summary phase: after summarizing each space to self");
1628 NOT_PRODUCT(print_region_ranges());
1629 NOT_PRODUCT(print_initial_summary_data(_summary_data, _space_info));
1630
1631 // The amount of live data that will end up in old space (assuming it fits).
1632 size_t old_space_total_live = 0;
1633 for (unsigned int id = old_space_id; id < last_space_id; ++id) {
1634 old_space_total_live += pointer_delta(_space_info[id].new_top(),
1635 _space_info[id].space()->bottom());
1636 }
1637
1638 MutableSpace* const old_space = _space_info[old_space_id].space();
1639 const size_t old_capacity = old_space->capacity_in_words();
1640 if (old_space_total_live > old_capacity) {
1641 // XXX - should also try to expand
|
1098 }
1099
1100 assert(total_invocations() >= _maximum_compaction_gc_num, "sanity");
1101 const size_t gcs_since_max = total_invocations() - _maximum_compaction_gc_num;
1102 const bool interval_ended = gcs_since_max > HeapMaximumCompactionInterval;
1103 if (maximum_compaction || cp == end_cp || interval_ended) {
1104 _maximum_compaction_gc_num = total_invocations();
1105 return sd.region_to_addr(cp);
1106 }
1107
1108 HeapWord* const new_top = _space_info[id].new_top();
1109 const size_t space_live = pointer_delta(new_top, space->bottom());
1110 const size_t space_used = space->used_in_words();
1111 const size_t space_capacity = space->capacity_in_words();
1112
1113 const double cur_density = double(space_live) / space_capacity;
1114 const double deadwood_density =
1115 (1.0 - cur_density) * (1.0 - cur_density) * cur_density * cur_density;
1116 const size_t deadwood_goal = size_t(space_capacity * deadwood_density);
1117
1118 log_develop_debug(gc, compaction)(
1119 "cur_dens=%5.3f dw_dens=%5.3f dw_goal=" SIZE_FORMAT,
1120 cur_density, deadwood_density, deadwood_goal);
1121 log_develop_debug(gc, compaction)(
1122 "space_live=" SIZE_FORMAT " space_used=" SIZE_FORMAT " "
1123 "space_cap=" SIZE_FORMAT,
1124 space_live, space_used,
1125 space_capacity);
1126
1127 // XXX - Use binary search?
1128 HeapWord* dense_prefix = sd.region_to_addr(cp);
1129 const RegionData* full_cp = cp;
1130 const RegionData* const top_cp = sd.addr_to_region_ptr(space->top() - 1);
1131 while (cp < end_cp) {
1132 HeapWord* region_destination = cp->destination();
1133 const size_t cur_deadwood = pointer_delta(dense_prefix, region_destination);
1134
1135 log_develop_trace(gc, compaction)(
1136 "c#=" SIZE_FORMAT_W(4) " dst=" PTR_FORMAT " "
1137 "dp=" PTR_FORMAT " cdw=" SIZE_FORMAT_W(8),
1138 sd.region(cp), p2i(region_destination),
1139 p2i(dense_prefix), cur_deadwood);
1140
1141 if (cur_deadwood >= deadwood_goal) {
1142 // Found the region that has the correct amount of deadwood to the left.
1143 // This typically occurs after crossing a fairly sparse set of regions, so
1144 // iterate backwards over those sparse regions, looking for the region
1145 // that has the lowest density of live objects 'to the right.'
1146 size_t space_to_left = sd.region(cp) * region_size;
1147 size_t live_to_left = space_to_left - cur_deadwood;
1148 size_t space_to_right = space_capacity - space_to_left;
1149 size_t live_to_right = space_live - live_to_left;
1150 double density_to_right = double(live_to_right) / space_to_right;
1151 while (cp > full_cp) {
1152 --cp;
1153 const size_t prev_region_live_to_right = live_to_right -
1154 cp->data_size();
1155 const size_t prev_region_space_to_right = space_to_right + region_size;
1156 double prev_region_density_to_right =
1157 double(prev_region_live_to_right) / prev_region_space_to_right;
1158 if (density_to_right <= prev_region_density_to_right) {
1159 return dense_prefix;
1160 }
1161
1162 log_develop_trace(gc, compaction)(
1163 "backing up from c=" SIZE_FORMAT_W(4) " d2r=%10.8f "
1164 "pc_d2r=%10.8f",
1165 sd.region(cp), density_to_right,
1166 prev_region_density_to_right);
1167
1168 dense_prefix -= region_size;
1169 live_to_right = prev_region_live_to_right;
1170 space_to_right = prev_region_space_to_right;
1171 density_to_right = prev_region_density_to_right;
1172 }
1173 return dense_prefix;
1174 }
1175
1176 dense_prefix += region_size;
1177 ++cp;
1178 }
1179
1180 return dense_prefix;
1181 }
1182
1183 #ifndef PRODUCT
1184 void PSParallelCompact::print_dense_prefix_stats(const char* const algorithm,
1185 const SpaceId id,
1186 const bool maximum_compaction,
1187 HeapWord* const addr)
1188 {
1189 const size_t region_idx = summary_data().addr_to_region_idx(addr);
1190 RegionData* const cp = summary_data().region(region_idx);
1191 const MutableSpace* const space = _space_info[id].space();
1192 HeapWord* const new_top = _space_info[id].new_top();
1193
1194 const size_t space_live = pointer_delta(new_top, space->bottom());
1195 const size_t dead_to_left = pointer_delta(addr, cp->destination());
1196 const size_t space_cap = space->capacity_in_words();
1197 const double dead_to_left_pct = double(dead_to_left) / space_cap;
1198 const size_t live_to_right = new_top - cp->destination();
1199 const size_t dead_to_right = space->top() - addr - live_to_right;
1200
1201 log_develop_debug(gc, compaction)(
1202 "%s=" PTR_FORMAT " dpc=" SIZE_FORMAT_W(5) " "
1203 "spl=" SIZE_FORMAT " "
1204 "d2l=" SIZE_FORMAT " d2l%%=%6.4f "
1205 "d2r=" SIZE_FORMAT " l2r=" SIZE_FORMAT " "
1206 "ratio=%10.8f",
1207 algorithm, p2i(addr), region_idx,
1208 space_live,
1209 dead_to_left, dead_to_left_pct,
1210 dead_to_right, live_to_right,
1211 double(dead_to_right) / live_to_right);
1212 }
1213 #endif // #ifndef PRODUCT
1214
1215 // Return a fraction indicating how much of the generation can be treated as
1216 // "dead wood" (i.e., not reclaimed). The function uses a normal distribution
1217 // based on the density of live objects in the generation to determine a limit,
1218 // which is then adjusted so the return value is min_percent when the density is
1219 // 1.
1220 //
1221 // The following table shows some return values for a different values of the
1222 // standard deviation (ParallelOldDeadWoodLimiterStdDev); the mean is 0.5 and
1223 // min_percent is 1.
1224 //
1225 // fraction allowed as dead wood
1226 // -----------------------------------------------------------------
1399 assert(total_invocations() >= _maximum_compaction_gc_num, "sanity");
1400 const size_t gcs_since_max = total_invocations() - _maximum_compaction_gc_num;
1401 const bool interval_ended = gcs_since_max > HeapMaximumCompactionInterval ||
1402 total_invocations() == HeapFirstMaximumCompactionCount;
1403 if (maximum_compaction || full_cp == top_cp || interval_ended) {
1404 _maximum_compaction_gc_num = total_invocations();
1405 return sd.region_to_addr(full_cp);
1406 }
1407
1408 const size_t space_live = pointer_delta(new_top, bottom);
1409 const size_t space_used = space->used_in_words();
1410 const size_t space_capacity = space->capacity_in_words();
1411
1412 const double density = double(space_live) / double(space_capacity);
1413 const size_t min_percent_free = MarkSweepDeadRatio;
1414 const double limiter = dead_wood_limiter(density, min_percent_free);
1415 const size_t dead_wood_max = space_used - space_live;
1416 const size_t dead_wood_limit = MIN2(size_t(space_capacity * limiter),
1417 dead_wood_max);
1418
1419 log_develop_debug(gc, compaction)(
1420 "space_live=" SIZE_FORMAT " space_used=" SIZE_FORMAT " "
1421 "space_cap=" SIZE_FORMAT,
1422 space_live, space_used,
1423 space_capacity);
1424 log_develop_debug(gc, compaction)(
1425 "dead_wood_limiter(%6.4f, " SIZE_FORMAT ")=%6.4f "
1426 "dead_wood_max=" SIZE_FORMAT " dead_wood_limit=" SIZE_FORMAT,
1427 density, min_percent_free, limiter,
1428 dead_wood_max, dead_wood_limit);
1429
1430 // Locate the region with the desired amount of dead space to the left.
1431 const RegionData* const limit_cp =
1432 dead_wood_limit_region(full_cp, top_cp, dead_wood_limit);
1433
1434 // Scan from the first region with dead space to the limit region and find the
1435 // one with the best (largest) reclaimed ratio.
1436 double best_ratio = 0.0;
1437 const RegionData* best_cp = full_cp;
1438 for (const RegionData* cp = full_cp; cp < limit_cp; ++cp) {
1439 double tmp_ratio = reclaimed_ratio(cp, bottom, top, new_top);
1440 if (tmp_ratio > best_ratio) {
1441 best_cp = cp;
1442 best_ratio = tmp_ratio;
1443 }
1444 }
1445
1446 return sd.region_to_addr(best_cp);
1447 }
1448
1522 _mark_bitmap.mark_obj(obj_beg, obj_len);
1523 _summary_data.add_obj(obj_beg, obj_len);
1524 assert(start_array(id) != NULL, "sanity");
1525 start_array(id)->allocate_block(obj_beg);
1526 }
1527 }
1528
1529 void
1530 PSParallelCompact::summarize_space(SpaceId id, bool maximum_compaction)
1531 {
1532 assert(id < last_space_id, "id out of range");
1533 assert(_space_info[id].dense_prefix() == _space_info[id].space()->bottom(),
1534 "should have been reset in summarize_spaces_quick()");
1535
1536 const MutableSpace* space = _space_info[id].space();
1537 if (_space_info[id].new_top() != space->bottom()) {
1538 HeapWord* dense_prefix_end = compute_dense_prefix(id, maximum_compaction);
1539 _space_info[id].set_dense_prefix(dense_prefix_end);
1540
1541 #ifndef PRODUCT
1542 if (log_is_enabled(Debug, gc, compaction)) {
1543 print_dense_prefix_stats("ratio", id, maximum_compaction,
1544 dense_prefix_end);
1545 HeapWord* addr = compute_dense_prefix_via_density(id, maximum_compaction);
1546 print_dense_prefix_stats("density", id, maximum_compaction, addr);
1547 }
1548 #endif // #ifndef PRODUCT
1549
1550 // Recompute the summary data, taking into account the dense prefix. If
1551 // every last byte will be reclaimed, then the existing summary data which
1552 // compacts everything can be left in place.
1553 if (!maximum_compaction && dense_prefix_end != space->bottom()) {
1554 // If dead space crosses the dense prefix boundary, it is (at least
1555 // partially) filled with a dummy object, marked live and added to the
1556 // summary data. This simplifies the copy/update phase and must be done
1557 // before the final locations of objects are determined, to prevent
1558 // leaving a fragment of dead space that is too small to fill.
1559 fill_dense_prefix_end(id);
1560
1561 // Compute the destination of each Region, and thus each object.
1562 _summary_data.summarize_dense_prefix(space->bottom(), dense_prefix_end);
1597 SIZE_FORMAT "-" SIZE_FORMAT " "
1598 "dst=" PTR_FORMAT "-" PTR_FORMAT " "
1599 SIZE_FORMAT "-" SIZE_FORMAT,
1600 src_space_id, space_names[src_space_id],
1601 dst_space_id, space_names[dst_space_id],
1602 p2i(src_beg), p2i(src_end),
1603 _summary_data.addr_to_region_idx(src_beg),
1604 _summary_data.addr_to_region_idx(src_end),
1605 p2i(dst_beg), p2i(dst_end),
1606 _summary_data.addr_to_region_idx(dst_beg),
1607 _summary_data.addr_to_region_idx(dst_end));
1608 }
1609 #endif // #ifndef PRODUCT
1610
1611 void PSParallelCompact::summary_phase(ParCompactionManager* cm,
1612 bool maximum_compaction)
1613 {
1614 GCTraceTime(Info, gc, phases) tm("Summary Phase", &_gc_timer);
1615
1616 #ifdef ASSERT
1617 log_develop_debug(gc, marking)(
1618 "add_obj_count=" SIZE_FORMAT " "
1619 "add_obj_bytes=" SIZE_FORMAT,
1620 add_obj_count,
1621 add_obj_size * HeapWordSize);
1622 log_develop_debug(gc, marking)(
1623 "mark_bitmap_count=" SIZE_FORMAT " "
1624 "mark_bitmap_bytes=" SIZE_FORMAT,
1625 mark_bitmap_count,
1626 mark_bitmap_size * HeapWordSize);
1627 #endif // #ifdef ASSERT
1628
1629 // Quick summarization of each space into itself, to see how much is live.
1630 summarize_spaces_quick();
1631
1632 log_develop_trace(gc, compaction)("summary phase: after summarizing each space to self");
1633 NOT_PRODUCT(print_region_ranges());
1634 NOT_PRODUCT(print_initial_summary_data(_summary_data, _space_info));
1635
1636 // The amount of live data that will end up in old space (assuming it fits).
1637 size_t old_space_total_live = 0;
1638 for (unsigned int id = old_space_id; id < last_space_id; ++id) {
1639 old_space_total_live += pointer_delta(_space_info[id].new_top(),
1640 _space_info[id].space()->bottom());
1641 }
1642
1643 MutableSpace* const old_space = _space_info[old_space_id].space();
1644 const size_t old_capacity = old_space->capacity_in_words();
1645 if (old_space_total_live > old_capacity) {
1646 // XXX - should also try to expand
|