hotspot/src/share/vm/memory/collectorPolicy.cpp
changeset 17320 e7e94e2542e4
parent 17031 9a576749065b
child 17322 35c488005999
equal deleted inserted replaced
17319:7704ecd22af4 17320:e7e94e2542e4
    46 #endif // INCLUDE_ALL_GCS
    46 #endif // INCLUDE_ALL_GCS
    47 
    47 
    48 // CollectorPolicy methods.
    48 // CollectorPolicy methods.
    49 
    49 
    50 void CollectorPolicy::initialize_flags() {
    50 void CollectorPolicy::initialize_flags() {
       
    51   assert(max_alignment() >= min_alignment(),
       
    52       err_msg("max_alignment: " SIZE_FORMAT " less than min_alignment: " SIZE_FORMAT,
       
    53           max_alignment(), min_alignment()));
       
    54   assert(max_alignment() % min_alignment() == 0,
       
    55       err_msg("max_alignment: " SIZE_FORMAT " not aligned by min_alignment: " SIZE_FORMAT,
       
    56           max_alignment(), min_alignment()));
       
    57 
    51   if (MetaspaceSize > MaxMetaspaceSize) {
    58   if (MetaspaceSize > MaxMetaspaceSize) {
    52     MaxMetaspaceSize = MetaspaceSize;
    59     MaxMetaspaceSize = MetaspaceSize;
    53   }
    60   }
    54   MetaspaceSize = MAX2(min_alignment(), align_size_down_(MetaspaceSize, min_alignment()));
    61   MetaspaceSize = MAX2(min_alignment(), align_size_down_(MetaspaceSize, min_alignment()));
    55   // Don't increase Metaspace size limit above specified.
    62   // Don't increase Metaspace size limit above specified.
   199 
   206 
   200 void GenCollectorPolicy::initialize_flags() {
   207 void GenCollectorPolicy::initialize_flags() {
   201   // All sizes must be multiples of the generation granularity.
   208   // All sizes must be multiples of the generation granularity.
   202   set_min_alignment((uintx) Generation::GenGrain);
   209   set_min_alignment((uintx) Generation::GenGrain);
   203   set_max_alignment(compute_max_alignment());
   210   set_max_alignment(compute_max_alignment());
   204   assert(max_alignment() >= min_alignment() &&
       
   205          max_alignment() % min_alignment() == 0,
       
   206          "invalid alignment constraints");
       
   207 
   211 
   208   CollectorPolicy::initialize_flags();
   212   CollectorPolicy::initialize_flags();
   209 
   213 
   210   // All generational heaps have a youngest gen; handle those flags here.
   214   // All generational heaps have a youngest gen; handle those flags here.
   211 
   215