diff 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
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Thu Apr 18 10:09:23 2013 -0700
+++ b/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Tue Feb 12 14:15:45 2013 -0800
@@ -225,7 +225,10 @@
         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.