< prev index next >

src/share/vm/memory/metaspace.cpp

Print this page
rev 11458 : 8024945: Remove check on minimum size of MetaspaceSize
Reviewed-by:


3089   _reserve_alignment = MAX2(page_size, (size_t)os::vm_allocation_granularity());
3090 
3091   // Do not use FLAG_SET_ERGO to update MaxMetaspaceSize, since this will
3092   // override if MaxMetaspaceSize was set on the command line or not.
3093   // This information is needed later to conform to the specification of the
3094   // java.lang.management.MemoryUsage API.
3095   //
3096   // Ideally, we would be able to set the default value of MaxMetaspaceSize in
3097   // globals.hpp to the aligned value, but this is not possible, since the
3098   // alignment depends on other flags being parsed.
3099   MaxMetaspaceSize = align_size_down_bounded(MaxMetaspaceSize, _reserve_alignment);
3100 
3101   if (MetaspaceSize > MaxMetaspaceSize) {
3102     MetaspaceSize = MaxMetaspaceSize;
3103   }
3104 
3105   MetaspaceSize = align_size_down_bounded(MetaspaceSize, _commit_alignment);
3106 
3107   assert(MetaspaceSize <= MaxMetaspaceSize, "MetaspaceSize should be limited by MaxMetaspaceSize");
3108 
3109   if (MetaspaceSize < 256*K) {
3110     vm_exit_during_initialization("Too small initial Metaspace size");
3111   }
3112 
3113   MinMetaspaceExpansion = align_size_down_bounded(MinMetaspaceExpansion, _commit_alignment);
3114   MaxMetaspaceExpansion = align_size_down_bounded(MaxMetaspaceExpansion, _commit_alignment);
3115 
3116   CompressedClassSpaceSize = align_size_down_bounded(CompressedClassSpaceSize, _reserve_alignment);
3117   set_compressed_class_space_size(CompressedClassSpaceSize);
3118 }
3119 
3120 void Metaspace::global_initialize() {
3121   MetaspaceGC::initialize();
3122 
3123   // Initialize the alignment for shared spaces.
3124   int max_alignment = os::vm_allocation_granularity();
3125   size_t cds_total = 0;
3126 
3127   MetaspaceShared::set_max_alignment(max_alignment);
3128 
3129   if (DumpSharedSpaces) {
3130 #if INCLUDE_CDS
3131     MetaspaceShared::estimate_regions_size();
3132 




3089   _reserve_alignment = MAX2(page_size, (size_t)os::vm_allocation_granularity());
3090 
3091   // Do not use FLAG_SET_ERGO to update MaxMetaspaceSize, since this will
3092   // override if MaxMetaspaceSize was set on the command line or not.
3093   // This information is needed later to conform to the specification of the
3094   // java.lang.management.MemoryUsage API.
3095   //
3096   // Ideally, we would be able to set the default value of MaxMetaspaceSize in
3097   // globals.hpp to the aligned value, but this is not possible, since the
3098   // alignment depends on other flags being parsed.
3099   MaxMetaspaceSize = align_size_down_bounded(MaxMetaspaceSize, _reserve_alignment);
3100 
3101   if (MetaspaceSize > MaxMetaspaceSize) {
3102     MetaspaceSize = MaxMetaspaceSize;
3103   }
3104 
3105   MetaspaceSize = align_size_down_bounded(MetaspaceSize, _commit_alignment);
3106 
3107   assert(MetaspaceSize <= MaxMetaspaceSize, "MetaspaceSize should be limited by MaxMetaspaceSize");
3108 




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


< prev index next >