8213563: appcds/sharedStrings/SharedStringsStress.java fails with 'GC triggered before VM initialization completed' error
authorjiangli
Tue, 13 Nov 2018 15:11:53 -0500
changeset 52503 7d3b82b338f7
parent 52501 2b5d37ad7d06
child 52504 29977ee892ad
8213563: appcds/sharedStrings/SharedStringsStress.java fails with 'GC triggered before VM initialization completed' error Summary: Move MetaspaceShared::read_extra_data() call to the main MetaspaceShared::preload_and_dump() operation. Reviewed-by: iklam
src/hotspot/share/memory/metaspaceShared.cpp
--- a/src/hotspot/share/memory/metaspaceShared.cpp	Tue Nov 13 13:45:43 2018 -0500
+++ b/src/hotspot/share/memory/metaspaceShared.cpp	Tue Nov 13 15:11:53 2018 -0500
@@ -338,12 +338,6 @@
       ClassLoaderExt::init_app_module_paths_start_index(header->_app_module_paths_start_index);
     }
   }
-
-  if (DumpSharedSpaces) {
-    if (SharedArchiveConfigFile) {
-      read_extra_data(SharedArchiveConfigFile, THREAD);
-    }
-  }
 }
 
 void MetaspaceShared::read_extra_data(const char* filename, TRAPS) {
@@ -1705,6 +1699,12 @@
 
     log_info(cds)("Shared spaces: preloaded %d classes", class_count);
 
+    if (SharedArchiveConfigFile) {
+      tty->print_cr("Reading extra data from %s ...", SharedArchiveConfigFile);
+      read_extra_data(SharedArchiveConfigFile, THREAD);
+    }
+    tty->print_cr("Reading extra data: done.");
+
     HeapShared::init_subgraph_entry_fields(THREAD);
 
     // Rewrite and link classes