comparison src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @ 263:12eea04c8b06

6672698: mangle_unused_area() should not remangle the entire heap at each collection. Summary: Maintain a high water mark for the allocations in a space and mangle only up to that high water mark. Reviewed-by: ysr, apetrusenko
author jmasa
date Wed, 09 Jul 2008 15:08:55 -0700
parents 05712c37c828
children 15dd2594d08e
comparison
equal deleted inserted replaced
225:286bee59f34b 263:12eea04c8b06
1055 CodeCache::gc_epilogue(); 1055 CodeCache::gc_epilogue();
1056 1056
1057 COMPILER2_PRESENT(DerivedPointerTable::update_pointers()); 1057 COMPILER2_PRESENT(DerivedPointerTable::update_pointers());
1058 1058
1059 ref_processor()->enqueue_discovered_references(NULL); 1059 ref_processor()->enqueue_discovered_references(NULL);
1060
1061 if (ZapUnusedHeapArea) {
1062 heap->gen_mangle_unused_area();
1063 }
1060 1064
1061 // Update time of last GC 1065 // Update time of last GC
1062 reset_millis_since_last_gc(); 1066 reset_millis_since_last_gc();
1063 } 1067 }
1064 1068
1957 PSYoungGen* young_gen = heap->young_gen(); 1961 PSYoungGen* young_gen = heap->young_gen();
1958 PSOldGen* old_gen = heap->old_gen(); 1962 PSOldGen* old_gen = heap->old_gen();
1959 PSPermGen* perm_gen = heap->perm_gen(); 1963 PSPermGen* perm_gen = heap->perm_gen();
1960 PSAdaptiveSizePolicy* size_policy = heap->size_policy(); 1964 PSAdaptiveSizePolicy* size_policy = heap->size_policy();
1961 1965
1966 if (ZapUnusedHeapArea) {
1967 // Save information needed to minimize mangling
1968 heap->record_gen_tops_before_GC();
1969 }
1970
1962 _print_phases = PrintGCDetails && PrintParallelOldGCPhaseTimes; 1971 _print_phases = PrintGCDetails && PrintParallelOldGCPhaseTimes;
1963 1972
1964 // Make sure data structures are sane, make the heap parsable, and do other 1973 // Make sure data structures are sane, make the heap parsable, and do other
1965 // miscellaneous bookkeeping. 1974 // miscellaneous bookkeeping.
1966 PreGCValues pre_gc_values; 1975 PreGCValues pre_gc_values;
2125 young_gen->to_space()->capacity_in_bytes(), 2134 young_gen->to_space()->capacity_in_bytes(),
2126 "Sizes of space in young gen are out-of-bounds"); 2135 "Sizes of space in young gen are out-of-bounds");
2127 size_t max_eden_size = young_gen->max_size() - 2136 size_t max_eden_size = young_gen->max_size() -
2128 young_gen->from_space()->capacity_in_bytes() - 2137 young_gen->from_space()->capacity_in_bytes() -
2129 young_gen->to_space()->capacity_in_bytes(); 2138 young_gen->to_space()->capacity_in_bytes();
2130 size_policy->compute_generation_free_space(young_gen->used_in_bytes(), 2139 size_policy->compute_generation_free_space(
2131 young_gen->eden_space()->used_in_bytes(), 2140 young_gen->used_in_bytes(),
2132 old_gen->used_in_bytes(), 2141 young_gen->eden_space()->used_in_bytes(),
2133 perm_gen->used_in_bytes(), 2142 old_gen->used_in_bytes(),
2134 young_gen->eden_space()->capacity_in_bytes(), 2143 perm_gen->used_in_bytes(),
2135 old_gen->max_gen_size(), 2144 young_gen->eden_space()->capacity_in_bytes(),
2136 max_eden_size, 2145 old_gen->max_gen_size(),
2137 true /* full gc*/, 2146 max_eden_size,
2138 gc_cause); 2147 true /* full gc*/,
2139 2148 gc_cause);
2140 heap->resize_old_gen(size_policy->calculated_old_free_size_in_bytes()); 2149
2150 heap->resize_old_gen(
2151 size_policy->calculated_old_free_size_in_bytes());
2141 2152
2142 // Don't resize the young generation at an major collection. A 2153 // Don't resize the young generation at an major collection. A
2143 // desired young generation size may have been calculated but 2154 // desired young generation size may have been calculated but
2144 // resizing the young generation complicates the code because the 2155 // resizing the young generation complicates the code because the
2145 // resizing of the old generation may have moved the boundary 2156 // resizing of the old generation may have moved the boundary
2206 // Re-verify object start arrays 2217 // Re-verify object start arrays
2207 if (VerifyObjectStartArray && 2218 if (VerifyObjectStartArray &&
2208 VerifyAfterGC) { 2219 VerifyAfterGC) {
2209 old_gen->verify_object_start_array(); 2220 old_gen->verify_object_start_array();
2210 perm_gen->verify_object_start_array(); 2221 perm_gen->verify_object_start_array();
2222 }
2223
2224 if (ZapUnusedHeapArea) {
2225 old_gen->object_space()->check_mangled_unused_area_complete();
2226 perm_gen->object_space()->check_mangled_unused_area_complete();
2211 } 2227 }
2212 2228
2213 NOT_PRODUCT(ref_processor()->verify_no_references_recorded()); 2229 NOT_PRODUCT(ref_processor()->verify_no_references_recorded());
2214 2230
2215 collection_exit.update(); 2231 collection_exit.update();