< prev index next >

src/hotspot/share/memory/metaspaceShared.cpp

Print this page


 316                 CompressedClassSpaceSize, p2i(tmp_class_space.base()));
 317 #endif
 318 
 319   // Start with 0 committed bytes. The memory will be committed as needed by
 320   // MetaspaceShared::commit_shared_space_to().
 321   if (!_shared_vs.initialize(_shared_rs, 0)) {
 322     vm_exit_during_initialization("Unable to allocate memory for shared space");
 323   }
 324 
 325   _mc_region.init(&_shared_rs);
 326   tty->print_cr("Allocated shared space: " SIZE_FORMAT " bytes at " PTR_FORMAT,
 327                 _shared_rs.size(), p2i(_shared_rs.base()));
 328 }
 329 
 330 // Called by universe_post_init()
 331 void MetaspaceShared::post_initialize(TRAPS) {
 332   if (UseSharedSpaces) {
 333     int size = FileMapInfo::get_number_of_shared_paths();
 334     if (size > 0) {
 335       SystemDictionaryShared::allocate_shared_data_arrays(size, THREAD);
 336       FileMapInfo::FileMapHeader* header = FileMapInfo::current_info()->header();
 337       ClassLoaderExt::init_paths_start_index(header->_app_class_paths_start_index);
 338       ClassLoaderExt::init_app_module_paths_start_index(header->_app_module_paths_start_index);
 339     }
 340   }
 341 
 342   if (DumpSharedSpaces) {
 343     if (SharedArchiveConfigFile) {
 344       read_extra_data(SharedArchiveConfigFile, THREAD);
 345     }
 346   }
 347 }
 348 
 349 void MetaspaceShared::read_extra_data(const char* filename, TRAPS) {
 350   HashtableTextDump reader(filename);
 351   reader.check_version("VERSION: 1.0");
 352 
 353   while (reader.remain() > 0) {
 354     int utf8_length;
 355     int prefix_type = reader.scan_prefix(&utf8_length);
 356     ResourceMark rm(THREAD);




 316                 CompressedClassSpaceSize, p2i(tmp_class_space.base()));
 317 #endif
 318 
 319   // Start with 0 committed bytes. The memory will be committed as needed by
 320   // MetaspaceShared::commit_shared_space_to().
 321   if (!_shared_vs.initialize(_shared_rs, 0)) {
 322     vm_exit_during_initialization("Unable to allocate memory for shared space");
 323   }
 324 
 325   _mc_region.init(&_shared_rs);
 326   tty->print_cr("Allocated shared space: " SIZE_FORMAT " bytes at " PTR_FORMAT,
 327                 _shared_rs.size(), p2i(_shared_rs.base()));
 328 }
 329 
 330 // Called by universe_post_init()
 331 void MetaspaceShared::post_initialize(TRAPS) {
 332   if (UseSharedSpaces) {
 333     int size = FileMapInfo::get_number_of_shared_paths();
 334     if (size > 0) {
 335       SystemDictionaryShared::allocate_shared_data_arrays(size, THREAD);
 336       FileMapHeader* header = FileMapInfo::current_info()->header();
 337       ClassLoaderExt::init_paths_start_index(header->_app_class_paths_start_index);
 338       ClassLoaderExt::init_app_module_paths_start_index(header->_app_module_paths_start_index);
 339     }
 340   }
 341 
 342   if (DumpSharedSpaces) {
 343     if (SharedArchiveConfigFile) {
 344       read_extra_data(SharedArchiveConfigFile, THREAD);
 345     }
 346   }
 347 }
 348 
 349 void MetaspaceShared::read_extra_data(const char* filename, TRAPS) {
 350   HashtableTextDump reader(filename);
 351   reader.check_version("VERSION: 1.0");
 352 
 353   while (reader.remain() > 0) {
 354     int utf8_length;
 355     int prefix_type = reader.scan_prefix(&utf8_length);
 356     ResourceMark rm(THREAD);


< prev index next >