src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
Print this page
rev 5869 : [mq]: free-cset-base
*** 5908,5917 ****
--- 5908,5920 ----
// the collection set. Ideally we would like to do this
// after we have finished the scanning/evacuation of the
// strong code roots for a particular heap region.
migrate_strong_code_roots();
+ // Purge superfluous chunks.
+ G1CodeRootSet::purge_chunks(G1CodeRootsChunkCacheKeepRatio);
+
if (g1_policy()->during_initial_mark_pause()) {
// Reset the claim values set during marking the strong code roots
reset_heap_region_claim_values();
}
*** 5968,5978 ****
}
void G1CollectedHeap::free_region(HeapRegion* hr,
size_t* pre_used,
FreeRegionList* free_list,
! bool par) {
assert(!hr->isHumongous(), "this is only for non-humongous regions");
assert(!hr->is_empty(), "the region should not be empty");
assert(free_list != NULL, "pre-condition");
// Clear the card counts for this region.
--- 5971,5981 ----
}
void G1CollectedHeap::free_region(HeapRegion* hr,
size_t* pre_used,
FreeRegionList* free_list,
! bool par, bool locked) {
assert(!hr->isHumongous(), "this is only for non-humongous regions");
assert(!hr->is_empty(), "the region should not be empty");
assert(free_list != NULL, "pre-condition");
// Clear the card counts for this region.
*** 5980,5990 ****
// (since we don't refine cards in young regions).
if (!hr->is_young()) {
_cg1r->hot_card_cache()->reset_card_counts(hr);
}
*pre_used += hr->used();
! hr->hr_clear(par, true /* clear_space */);
free_list->add_as_head(hr);
}
void G1CollectedHeap::free_humongous_region(HeapRegion* hr,
size_t* pre_used,
--- 5983,5993 ----
// (since we don't refine cards in young regions).
if (!hr->is_young()) {
_cg1r->hot_card_cache()->reset_card_counts(hr);
}
*pre_used += hr->used();
! hr->hr_clear(par, true /* clear_space */, locked);
free_list->add_as_head(hr);
}
void G1CollectedHeap::free_humongous_region(HeapRegion* hr,
size_t* pre_used,
*** 6202,6212 ****
start_sec = os::elapsedTime();
non_young = true;
}
}
! rs_lengths += cur->rem_set()->occupied();
HeapRegion* next = cur->next_in_collection_set();
assert(cur->in_collection_set(), "bad CS");
cur->set_next_in_collection_set(NULL);
cur->set_in_collection_set(false);
--- 6205,6215 ----
start_sec = os::elapsedTime();
non_young = true;
}
}
! rs_lengths += cur->rem_set()->occupied_locked();
HeapRegion* next = cur->next_in_collection_set();
assert(cur->in_collection_set(), "bad CS");
cur->set_next_in_collection_set(NULL);
cur->set_in_collection_set(false);
*** 6235,6245 ****
if (!cur->evacuation_failed()) {
MemRegion used_mr = cur->used_region();
// And the region is empty.
assert(!used_mr.is_empty(), "Should not have empty regions in a CS.");
! free_region(cur, &pre_used, &local_free_list, false /* par */);
} else {
cur->uninstall_surv_rate_group();
if (cur->is_young()) {
cur->set_young_index_in_cset(-1);
}
--- 6238,6248 ----
if (!cur->evacuation_failed()) {
MemRegion used_mr = cur->used_region();
// And the region is empty.
assert(!used_mr.is_empty(), "Should not have empty regions in a CS.");
! free_region(cur, &pre_used, &local_free_list, false /* par */, true /* locked */);
} else {
cur->uninstall_surv_rate_group();
if (cur->is_young()) {
cur->set_young_index_in_cset(-1);
}
*** 6882,6892 ****
HeapRegionRemSet* hrrs = hr->rem_set();
if (hr->continuesHumongous()) {
// Code roots should never be attached to a continuation of a humongous region
assert(hrrs->strong_code_roots_list_length() == 0,
err_msg("code roots should never be attached to continuations of humongous region "HR_FORMAT
! " starting at "HR_FORMAT", but has "INT32_FORMAT,
HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()),
hrrs->strong_code_roots_list_length()));
return false;
}
--- 6885,6895 ----
HeapRegionRemSet* hrrs = hr->rem_set();
if (hr->continuesHumongous()) {
// Code roots should never be attached to a continuation of a humongous region
assert(hrrs->strong_code_roots_list_length() == 0,
err_msg("code roots should never be attached to continuations of humongous region "HR_FORMAT
! " starting at "HR_FORMAT", but has "SIZE_FORMAT,
HR_FORMAT_PARAMS(hr), HR_FORMAT_PARAMS(hr->humongous_start_region()),
hrrs->strong_code_roots_list_length()));
return false;
}