< prev index next >

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

Print this page
rev 13281 : imported patch 8183121-add-information-about-scanned-skipped-cards-during-updaters
rev 13284 : imported patch 8184346-cleanup-g1cmbitmap
rev 13286 : imported patch 8184346-erikd-mgerdin-review


4927     // SATB marking is even more conservative than the remembered set.
4928     // So if at this point in the collection there is no remembered set entry,
4929     // nobody has a reference to it.
4930     // At the start of collection we flush all refinement logs, and remembered sets
4931     // are completely up-to-date wrt to references to the humongous object.
4932     //
4933     // Other implementation considerations:
4934     // - never consider object arrays at this time because they would pose
4935     // considerable effort for cleaning up the the remembered sets. This is
4936     // required because stale remembered sets might reference locations that
4937     // are currently allocated into.
4938     uint region_idx = r->hrm_index();
4939     if (!g1h->is_humongous_reclaim_candidate(region_idx) ||
4940         !r->rem_set()->is_empty()) {
4941       log_debug(gc, humongous)("Live humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT "  with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d",
4942                                region_idx,
4943                                (size_t)obj->size() * HeapWordSize,
4944                                p2i(r->bottom()),
4945                                r->rem_set()->occupied(),
4946                                r->rem_set()->strong_code_roots_list_length(),
4947                                next_bitmap->isMarked(r->bottom()),
4948                                g1h->is_humongous_reclaim_candidate(region_idx),
4949                                obj->is_typeArray()
4950                               );
4951       return false;
4952     }
4953 
4954     guarantee(obj->is_typeArray(),
4955               "Only eagerly reclaiming type arrays is supported, but the object "
4956               PTR_FORMAT " is not.", p2i(r->bottom()));
4957 
4958     log_debug(gc, humongous)("Dead humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT " with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d",
4959                              region_idx,
4960                              (size_t)obj->size() * HeapWordSize,
4961                              p2i(r->bottom()),
4962                              r->rem_set()->occupied(),
4963                              r->rem_set()->strong_code_roots_list_length(),
4964                              next_bitmap->isMarked(r->bottom()),
4965                              g1h->is_humongous_reclaim_candidate(region_idx),
4966                              obj->is_typeArray()
4967                             );
4968 
4969     // Need to clear mark bit of the humongous object if already set.
4970     if (next_bitmap->isMarked(r->bottom())) {
4971       next_bitmap->clear(r->bottom());
4972     }
4973     _humongous_objects_reclaimed++;
4974     do {
4975       HeapRegion* next = g1h->next_region_in_humongous(r);
4976       _freed_bytes += r->used();
4977       r->set_containing_set(NULL);
4978       _humongous_regions_reclaimed++;
4979       g1h->free_humongous_region(r, _free_region_list, false /* skip_remset */ );
4980       r = next;
4981     } while (r != NULL);
4982 
4983     return false;
4984   }
4985 
4986   uint humongous_objects_reclaimed() {
4987     return _humongous_objects_reclaimed;
4988   }
4989 
4990   uint humongous_regions_reclaimed() {




4927     // SATB marking is even more conservative than the remembered set.
4928     // So if at this point in the collection there is no remembered set entry,
4929     // nobody has a reference to it.
4930     // At the start of collection we flush all refinement logs, and remembered sets
4931     // are completely up-to-date wrt to references to the humongous object.
4932     //
4933     // Other implementation considerations:
4934     // - never consider object arrays at this time because they would pose
4935     // considerable effort for cleaning up the the remembered sets. This is
4936     // required because stale remembered sets might reference locations that
4937     // are currently allocated into.
4938     uint region_idx = r->hrm_index();
4939     if (!g1h->is_humongous_reclaim_candidate(region_idx) ||
4940         !r->rem_set()->is_empty()) {
4941       log_debug(gc, humongous)("Live humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT "  with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d",
4942                                region_idx,
4943                                (size_t)obj->size() * HeapWordSize,
4944                                p2i(r->bottom()),
4945                                r->rem_set()->occupied(),
4946                                r->rem_set()->strong_code_roots_list_length(),
4947                                next_bitmap->is_marked(r->bottom()),
4948                                g1h->is_humongous_reclaim_candidate(region_idx),
4949                                obj->is_typeArray()
4950                               );
4951       return false;
4952     }
4953 
4954     guarantee(obj->is_typeArray(),
4955               "Only eagerly reclaiming type arrays is supported, but the object "
4956               PTR_FORMAT " is not.", p2i(r->bottom()));
4957 
4958     log_debug(gc, humongous)("Dead humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT " with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d",
4959                              region_idx,
4960                              (size_t)obj->size() * HeapWordSize,
4961                              p2i(r->bottom()),
4962                              r->rem_set()->occupied(),
4963                              r->rem_set()->strong_code_roots_list_length(),
4964                              next_bitmap->is_marked(r->bottom()),
4965                              g1h->is_humongous_reclaim_candidate(region_idx),
4966                              obj->is_typeArray()
4967                             );
4968 
4969     // Need to clear mark bit of the humongous object if already set.
4970     if (next_bitmap->is_marked(r->bottom())) {
4971       next_bitmap->clear(r->bottom());
4972     }
4973     _humongous_objects_reclaimed++;
4974     do {
4975       HeapRegion* next = g1h->next_region_in_humongous(r);
4976       _freed_bytes += r->used();
4977       r->set_containing_set(NULL);
4978       _humongous_regions_reclaimed++;
4979       g1h->free_humongous_region(r, _free_region_list, false /* skip_remset */ );
4980       r = next;
4981     } while (r != NULL);
4982 
4983     return false;
4984   }
4985 
4986   uint humongous_objects_reclaimed() {
4987     return _humongous_objects_reclaimed;
4988   }
4989 
4990   uint humongous_regions_reclaimed() {


< prev index next >