< prev index next >

src/share/vm/gc/g1/collectionSetChooser.cpp

Print this page




 101     guarantee(regions_at(index) == NULL,
 102               "all entries before _curr_index should be NULL");
 103     index += 1;
 104   }
 105   HeapRegion *prev = NULL;
 106   while (index < _length) {
 107     HeapRegion *curr = regions_at(index++);
 108     guarantee(curr != NULL, "Regions in _regions array cannot be NULL");
 109     guarantee(!curr->is_young(), "should not be young!");
 110     guarantee(!curr->is_humongous(), "should not be humongous!");
 111     if (prev != NULL) {
 112       guarantee(order_regions(prev, curr) != 1,
 113                 err_msg("GC eff prev: %1.4f GC eff curr: %1.4f",
 114                         prev->gc_efficiency(), curr->gc_efficiency()));
 115     }
 116     sum_of_reclaimable_bytes += curr->reclaimable_bytes();
 117     prev = curr;
 118   }
 119   guarantee(sum_of_reclaimable_bytes == _remaining_reclaimable_bytes,
 120             err_msg("reclaimable bytes inconsistent, "
 121                     "remaining: "SIZE_FORMAT" sum: "SIZE_FORMAT,
 122                     _remaining_reclaimable_bytes, sum_of_reclaimable_bytes));
 123 }
 124 #endif // !PRODUCT
 125 
 126 void CollectionSetChooser::sort_regions() {
 127   // First trim any unused portion of the top in the parallel case.
 128   if (_first_par_unreserved_idx > 0) {
 129     assert(_first_par_unreserved_idx <= regions_length(),
 130            "Or we didn't reserved enough length");
 131     regions_trunc_to(_first_par_unreserved_idx);
 132   }
 133   _regions.sort(order_regions);
 134   assert(_length <= regions_length(), "Requirement");
 135 #ifdef ASSERT
 136   for (uint i = 0; i < _length; i++) {
 137     assert(regions_at(i) != NULL, "Should be true by sorting!");
 138   }
 139 #endif // ASSERT
 140   if (G1PrintRegionLivenessInfo) {
 141     G1PrintRegionLivenessInfoClosure cl(gclog_or_tty, "Post-Sorting");




 101     guarantee(regions_at(index) == NULL,
 102               "all entries before _curr_index should be NULL");
 103     index += 1;
 104   }
 105   HeapRegion *prev = NULL;
 106   while (index < _length) {
 107     HeapRegion *curr = regions_at(index++);
 108     guarantee(curr != NULL, "Regions in _regions array cannot be NULL");
 109     guarantee(!curr->is_young(), "should not be young!");
 110     guarantee(!curr->is_humongous(), "should not be humongous!");
 111     if (prev != NULL) {
 112       guarantee(order_regions(prev, curr) != 1,
 113                 err_msg("GC eff prev: %1.4f GC eff curr: %1.4f",
 114                         prev->gc_efficiency(), curr->gc_efficiency()));
 115     }
 116     sum_of_reclaimable_bytes += curr->reclaimable_bytes();
 117     prev = curr;
 118   }
 119   guarantee(sum_of_reclaimable_bytes == _remaining_reclaimable_bytes,
 120             err_msg("reclaimable bytes inconsistent, "
 121                     "remaining: " SIZE_FORMAT " sum: " SIZE_FORMAT,
 122                     _remaining_reclaimable_bytes, sum_of_reclaimable_bytes));
 123 }
 124 #endif // !PRODUCT
 125 
 126 void CollectionSetChooser::sort_regions() {
 127   // First trim any unused portion of the top in the parallel case.
 128   if (_first_par_unreserved_idx > 0) {
 129     assert(_first_par_unreserved_idx <= regions_length(),
 130            "Or we didn't reserved enough length");
 131     regions_trunc_to(_first_par_unreserved_idx);
 132   }
 133   _regions.sort(order_regions);
 134   assert(_length <= regions_length(), "Requirement");
 135 #ifdef ASSERT
 136   for (uint i = 0; i < _length; i++) {
 137     assert(regions_at(i) != NULL, "Should be true by sorting!");
 138   }
 139 #endif // ASSERT
 140   if (G1PrintRegionLivenessInfo) {
 141     G1PrintRegionLivenessInfoClosure cl(gclog_or_tty, "Post-Sorting");


< prev index next >