--- old/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-02-13 17:47:57.873769931 +0100 +++ new/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp 2014-02-13 17:47:57.641769937 +0100 @@ -5910,6 +5910,9 @@ // 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(); @@ -5970,7 +5973,7 @@ void G1CollectedHeap::free_region(HeapRegion* hr, size_t* pre_used, FreeRegionList* free_list, - bool par) { + 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"); @@ -5982,7 +5985,7 @@ _cg1r->hot_card_cache()->reset_card_counts(hr); } *pre_used += hr->used(); - hr->hr_clear(par, true /* clear_space */); + hr->hr_clear(par, true /* clear_space */, locked); free_list->add_as_head(hr); } @@ -6204,7 +6207,7 @@ } } - rs_lengths += cur->rem_set()->occupied(); + rs_lengths += cur->rem_set()->occupied_locked(); HeapRegion* next = cur->next_in_collection_set(); assert(cur->in_collection_set(), "bad CS"); @@ -6237,7 +6240,7 @@ // 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 */); + free_region(cur, &pre_used, &local_free_list, false /* par */, true /* locked */); } else { cur->uninstall_surv_rate_group(); if (cur->is_young()) { @@ -6884,7 +6887,7 @@ // 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, + " 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;