comparison src/share/vm/gc_implementation/shared/vmGCOperations.cpp @ 10183:868d87ed63c8

8008966: NPG: Inefficient Metaspace counter functions cause large young GC regressions Reviewed-by: mgerdin, coleenp
author jmasa
date Tue, 12 Feb 2013 14:15:45 -0800
parents 3c9bc17b9403
children f2110083203d
comparison
equal deleted inserted replaced
10182:5c93c1f61226 10183:868d87ed63c8
223 // be the criteria for clearing SoftReferences. 223 // be the criteria for clearing SoftReferences.
224 if (Verbose && PrintGCDetails && UseConcMarkSweepGC) { 224 if (Verbose && PrintGCDetails && UseConcMarkSweepGC) {
225 gclog_or_tty->print_cr("\nCMS full GC for Metaspace"); 225 gclog_or_tty->print_cr("\nCMS full GC for Metaspace");
226 } 226 }
227 heap->collect_as_vm_thread(GCCause::_metadata_GC_threshold); 227 heap->collect_as_vm_thread(GCCause::_metadata_GC_threshold);
228 _result = _loader_data->metaspace_non_null()->allocate(_size, _mdtype); 228 // After a GC try to allocate without expanding. Could fail
229 // and expansion will be tried below.
230 _result =
231 _loader_data->metaspace_non_null()->allocate(_size, _mdtype);
229 } 232 }
230 if (_result == NULL && !UseConcMarkSweepGC /* CMS already tried */) { 233 if (_result == NULL && !UseConcMarkSweepGC /* CMS already tried */) {
231 // If still failing, allow the Metaspace to expand. 234 // If still failing, allow the Metaspace to expand.
232 // See delta_capacity_until_GC() for explanation of the 235 // See delta_capacity_until_GC() for explanation of the
233 // amount of the expansion. 236 // amount of the expansion.