8008966: NPG: Inefficient Metaspace counter functions cause large young GC regressions

Reviewed-by: mgerdin, coleenp
This commit is contained in:
Jon Masamitsu 2013-02-12 14:15:45 -08:00
parent eafc00bc25
commit d72b516201
12 changed files with 398 additions and 175 deletions

View file

@ -225,7 +225,10 @@ void VM_CollectForMetadataAllocation::doit() {
gclog_or_tty->print_cr("\nCMS full GC for Metaspace");
}
heap->collect_as_vm_thread(GCCause::_metadata_GC_threshold);
_result = _loader_data->metaspace_non_null()->allocate(_size, _mdtype);
// After a GC try to allocate without expanding. Could fail
// and expansion will be tried below.
_result =
_loader_data->metaspace_non_null()->allocate(_size, _mdtype);
}
if (_result == NULL && !UseConcMarkSweepGC /* CMS already tried */) {
// If still failing, allow the Metaspace to expand.