< prev index next >

src/share/vm/memory/metaspace.cpp

Print this page




3179   // globals.hpp to the aligned value, but this is not possible, since the
3180   // alignment depends on other flags being parsed.
3181   MaxMetaspaceSize = align_size_down_bounded(MaxMetaspaceSize, _reserve_alignment);
3182 
3183   if (MetaspaceSize > MaxMetaspaceSize) {
3184     MetaspaceSize = MaxMetaspaceSize;
3185   }
3186 
3187   MetaspaceSize = align_size_down_bounded(MetaspaceSize, _commit_alignment);
3188 
3189   assert(MetaspaceSize <= MaxMetaspaceSize, "MetaspaceSize should be limited by MaxMetaspaceSize");
3190 
3191   if (MetaspaceSize < 256*K) {
3192     vm_exit_during_initialization("Too small initial Metaspace size");
3193   }
3194 
3195   MinMetaspaceExpansion = align_size_down_bounded(MinMetaspaceExpansion, _commit_alignment);
3196   MaxMetaspaceExpansion = align_size_down_bounded(MaxMetaspaceExpansion, _commit_alignment);
3197 
3198   CompressedClassSpaceSize = align_size_down_bounded(CompressedClassSpaceSize, _reserve_alignment);
















3199   set_compressed_class_space_size(CompressedClassSpaceSize);
3200 }
3201 
3202 void Metaspace::global_initialize() {
3203   MetaspaceGC::initialize();
3204 
3205   // Initialize the alignment for shared spaces.
3206   int max_alignment = os::vm_allocation_granularity();
3207   size_t cds_total = 0;
3208 
3209   MetaspaceShared::set_max_alignment(max_alignment);
3210 
3211   if (DumpSharedSpaces) {
3212 #if INCLUDE_CDS
3213     MetaspaceShared::estimate_regions_size();
3214 
3215     SharedReadOnlySize  = align_size_up(SharedReadOnlySize,  max_alignment);
3216     SharedReadWriteSize = align_size_up(SharedReadWriteSize, max_alignment);
3217     SharedMiscDataSize  = align_size_up(SharedMiscDataSize,  max_alignment);
3218     SharedMiscCodeSize  = align_size_up(SharedMiscCodeSize,  max_alignment);




3179   // globals.hpp to the aligned value, but this is not possible, since the
3180   // alignment depends on other flags being parsed.
3181   MaxMetaspaceSize = align_size_down_bounded(MaxMetaspaceSize, _reserve_alignment);
3182 
3183   if (MetaspaceSize > MaxMetaspaceSize) {
3184     MetaspaceSize = MaxMetaspaceSize;
3185   }
3186 
3187   MetaspaceSize = align_size_down_bounded(MetaspaceSize, _commit_alignment);
3188 
3189   assert(MetaspaceSize <= MaxMetaspaceSize, "MetaspaceSize should be limited by MaxMetaspaceSize");
3190 
3191   if (MetaspaceSize < 256*K) {
3192     vm_exit_during_initialization("Too small initial Metaspace size");
3193   }
3194 
3195   MinMetaspaceExpansion = align_size_down_bounded(MinMetaspaceExpansion, _commit_alignment);
3196   MaxMetaspaceExpansion = align_size_down_bounded(MaxMetaspaceExpansion, _commit_alignment);
3197 
3198   CompressedClassSpaceSize = align_size_down_bounded(CompressedClassSpaceSize, _reserve_alignment);
3199 
3200   if (UseCompressedClassPointers) {
3201     if ((InitialBootClassLoaderMetaspaceSize + CompressedClassSpaceSize)
3202                                                           >= MaxMetaspaceSize) {
3203       vm_exit_during_initialization(
3204        "Sum of InitialBootClassLoaderMetaspaceSize and CompressedClassSpaceSize"
3205        " should be less than MaxMetaspaceSize.");
3206     }
3207   } else {
3208     if (InitialBootClassLoaderMetaspaceSize >= MaxMetaspaceSize) {
3209       vm_exit_during_initialization(
3210        "InitialBootClassLoaderMetaspaceSize should be less than"
3211                                                         " MaxMetaspaceSize.");
3212     }
3213   }
3214 
3215   set_compressed_class_space_size(CompressedClassSpaceSize);
3216 }
3217 
3218 void Metaspace::global_initialize() {
3219   MetaspaceGC::initialize();
3220 
3221   // Initialize the alignment for shared spaces.
3222   int max_alignment = os::vm_allocation_granularity();
3223   size_t cds_total = 0;
3224 
3225   MetaspaceShared::set_max_alignment(max_alignment);
3226 
3227   if (DumpSharedSpaces) {
3228 #if INCLUDE_CDS
3229     MetaspaceShared::estimate_regions_size();
3230 
3231     SharedReadOnlySize  = align_size_up(SharedReadOnlySize,  max_alignment);
3232     SharedReadWriteSize = align_size_up(SharedReadWriteSize, max_alignment);
3233     SharedMiscDataSize  = align_size_up(SharedMiscDataSize,  max_alignment);
3234     SharedMiscCodeSize  = align_size_up(SharedMiscCodeSize,  max_alignment);


< prev index next >