src/share/vm/memory/metaspace.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/memory

src/share/vm/memory/metaspace.cpp

Print this page




3109   }
3110 
3111   MinMetaspaceExpansion = align_size_down_bounded(MinMetaspaceExpansion, _commit_alignment);
3112   MaxMetaspaceExpansion = align_size_down_bounded(MaxMetaspaceExpansion, _commit_alignment);
3113 
3114   CompressedClassSpaceSize = align_size_down_bounded(CompressedClassSpaceSize, _reserve_alignment);
3115   set_compressed_class_space_size(CompressedClassSpaceSize);
3116 }
3117 
3118 void Metaspace::global_initialize() {
3119   MetaspaceGC::initialize();
3120 
3121   // Initialize the alignment for shared spaces.
3122   int max_alignment = os::vm_allocation_granularity();
3123   size_t cds_total = 0;
3124 
3125   MetaspaceShared::set_max_alignment(max_alignment);
3126 
3127   if (DumpSharedSpaces) {
3128 #if INCLUDE_CDS


3129     SharedReadOnlySize  = align_size_up(SharedReadOnlySize,  max_alignment);
3130     SharedReadWriteSize = align_size_up(SharedReadWriteSize, max_alignment);
3131     SharedMiscDataSize  = align_size_up(SharedMiscDataSize,  max_alignment);
3132     SharedMiscCodeSize  = align_size_up(SharedMiscCodeSize,  max_alignment);
3133 
3134     // Initialize with the sum of the shared space sizes.  The read-only
3135     // and read write metaspace chunks will be allocated out of this and the
3136     // remainder is the misc code and data chunks.
3137     cds_total = FileMapInfo::shared_spaces_size();
3138     cds_total = align_size_up(cds_total, _reserve_alignment);
3139     _space_list = new VirtualSpaceList(cds_total/wordSize);
3140     _chunk_manager_metadata = new ChunkManager(SpecializedChunk, SmallChunk, MediumChunk);
3141 
3142     if (!_space_list->initialization_succeeded()) {
3143       vm_exit_during_initialization("Unable to dump shared archive.", NULL);
3144     }
3145 
3146 #ifdef _LP64
3147     if (cds_total + compressed_class_space_size() > UnscaledClassSpaceMax) {
3148       vm_exit_during_initialization("Unable to dump shared archive.",




3109   }
3110 
3111   MinMetaspaceExpansion = align_size_down_bounded(MinMetaspaceExpansion, _commit_alignment);
3112   MaxMetaspaceExpansion = align_size_down_bounded(MaxMetaspaceExpansion, _commit_alignment);
3113 
3114   CompressedClassSpaceSize = align_size_down_bounded(CompressedClassSpaceSize, _reserve_alignment);
3115   set_compressed_class_space_size(CompressedClassSpaceSize);
3116 }
3117 
3118 void Metaspace::global_initialize() {
3119   MetaspaceGC::initialize();
3120 
3121   // Initialize the alignment for shared spaces.
3122   int max_alignment = os::vm_allocation_granularity();
3123   size_t cds_total = 0;
3124 
3125   MetaspaceShared::set_max_alignment(max_alignment);
3126 
3127   if (DumpSharedSpaces) {
3128 #if INCLUDE_CDS
3129     MetaspaceShared::estimate_regions_size();
3130 
3131     SharedReadOnlySize  = align_size_up(SharedReadOnlySize,  max_alignment);
3132     SharedReadWriteSize = align_size_up(SharedReadWriteSize, max_alignment);
3133     SharedMiscDataSize  = align_size_up(SharedMiscDataSize,  max_alignment);
3134     SharedMiscCodeSize  = align_size_up(SharedMiscCodeSize,  max_alignment);
3135 
3136     // Initialize with the sum of the shared space sizes.  The read-only
3137     // and read write metaspace chunks will be allocated out of this and the
3138     // remainder is the misc code and data chunks.
3139     cds_total = FileMapInfo::shared_spaces_size();
3140     cds_total = align_size_up(cds_total, _reserve_alignment);
3141     _space_list = new VirtualSpaceList(cds_total/wordSize);
3142     _chunk_manager_metadata = new ChunkManager(SpecializedChunk, SmallChunk, MediumChunk);
3143 
3144     if (!_space_list->initialization_succeeded()) {
3145       vm_exit_during_initialization("Unable to dump shared archive.", NULL);
3146     }
3147 
3148 #ifdef _LP64
3149     if (cds_total + compressed_class_space_size() > UnscaledClassSpaceMax) {
3150       vm_exit_during_initialization("Unable to dump shared archive.",


src/share/vm/memory/metaspace.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File