diff src/share/vm/gc_implementation/shared/vmGCOperations.cpp @ 17876:9c3dc501b5eb

8028498: runtime/SharedArchiveFile/CdsDifferentObjectAlignment.java asserts in RT_Baseline Summary: Preventing GCs to occur before VM is completely initialized. This was previously partly done by one part of the GC locker which not was removed. Reviewed-by: coleenp, pliden
author sjohanss
date Thu, 13 Feb 2014 10:05:03 +0100
parents bf9e50c573ad
children 52b4284cb496 2c6ef90f030a
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Mon Apr 14 20:56:48 2014 -0400
+++ b/src/share/vm/gc_implementation/shared/vmGCOperations.cpp	Thu Feb 13 10:05:03 2014 +0100
@@ -103,6 +103,15 @@
   assert(((_gc_cause != GCCause::_no_gc) &&
           (_gc_cause != GCCause::_no_cause_specified)), "Illegal GCCause");
 
+  // To be able to handle a GC the VM initialization needs to be completed.
+  if (!is_init_completed()) {
+    vm_exit_during_initialization(
+      err_msg("GC triggered before VM initialization completed. Try increasing "
+              "NewSize, current value " UINTX_FORMAT "%s.",
+              byte_size_in_proper_unit(NewSize),
+              proper_unit_for_byte_size(NewSize)));
+  }
+
   acquire_pending_list_lock();
   // If the GC count has changed someone beat us to the collection
   // Get the Heap_lock after the pending_list_lock.