< prev index next >
src/hotspot/share/memory/metaspaceShared.cpp
Print this page
*** 1205,1218 ****
};
#endif
public:
static void copy_and_compact() {
- // We should no longer allocate anything from the metaspace, so that
- // we can have a stable set of MetaspaceObjs to work with.
- Metaspace::freeze();
-
ResourceMark rm;
SortedSymbolClosure the_ssc; // StackObj
_ssc = &the_ssc;
tty->print_cr("Scanning all metaspace objects ... ");
--- 1205,1214 ----
*** 1355,1364 ****
--- 1351,1368 ----
return buckets_top;
}
void VM_PopulateDumpSharedSpace::doit() {
+ // We should no longer allocate anything from the metaspace, so that:
+ //
+ // (1) Metaspace::allocate might trigger GC if we have run out of
+ // committed metaspace, but we can't GC because we're running
+ // in the VM thread.
+ // (2) ArchiveCompactor needs to work with a stable set of MetaspaceObjs.
+ Metaspace::freeze();
+
Thread* THREAD = VMThread::vm_thread();
FileMapInfo::check_nonempty_dir_in_shared_path_table();
NOT_PRODUCT(SystemDictionary::verify();)
*** 1419,1430 ****
// We don't support archiving unsafe anonymous classes. Verify that they are not stored in
// any dictionaries.
NOT_PRODUCT(assert_no_unsafe_anonymous_classes_in_dictionaries());
- SystemDictionaryShared::finalize_verification_constraints();
-
ArchiveCompactor::initialize();
ArchiveCompactor::copy_and_compact();
dump_symbols();
--- 1423,1432 ----
*** 1715,1724 ****
--- 1717,1728 ----
tty->print_cr("Rewriting and linking classes: done");
SystemDictionary::clear_invoke_method_table();
HeapShared::init_archivable_static_fields(THREAD);
+ SystemDictionaryShared::finalize_verification_constraints();
+
VM_PopulateDumpSharedSpace op;
VMThread::execute(&op);
}
}
< prev index next >