< prev index next >

src/share/vm/runtime/commandLineFlagConstraintsGC.cpp

Print this page




 590         CommandLineError::print(verbose,
 591                                 "GCPauseIntervalMillis cannot be set "
 592                                 "without setting MaxGCPauseMillis\n");
 593         return Flag::VIOLATES_CONSTRAINT;
 594       }
 595 
 596       if (value <= MaxGCPauseMillis) {
 597         CommandLineError::print(verbose,
 598                                 "GCPauseIntervalMillis (" UINTX_FORMAT ") must be "
 599                                 "greater than MaxGCPauseMillis (" UINTX_FORMAT ")\n",
 600                                 value, MaxGCPauseMillis);
 601         return Flag::VIOLATES_CONSTRAINT;
 602       }
 603     }
 604   }
 605 #endif
 606   return Flag::SUCCESS;
 607 }
 608 
 609 Flag::Error InitialBootClassLoaderMetaspaceSizeConstraintFunc(size_t value, bool verbose) {
 610   size_t aligned_max = align_size_down(max_uintx/2, Metaspace::reserve_alignment_words());
 611   if (value > aligned_max) {
 612     CommandLineError::print(verbose,
 613                             "InitialBootClassLoaderMetaspaceSize (" SIZE_FORMAT ") must be "
 614                             "less than or equal to aligned maximum value (" SIZE_FORMAT ")\n",
 615                             value, aligned_max);
 616     return Flag::VIOLATES_CONSTRAINT;
 617   }
 618   return Flag::SUCCESS;
 619 }
 620 
 621 // To avoid an overflow by 'align_size_up(value, alignment)'.
 622 static Flag::Error MaxSizeForAlignment(const char* name, size_t value, size_t alignment, bool verbose) {
 623   size_t aligned_max = ((max_uintx - alignment) & ~(alignment-1));
 624   if (value > aligned_max) {
 625     CommandLineError::print(verbose,
 626                             "%s (" SIZE_FORMAT ") must be "
 627                             "less than or equal to aligned maximum value (" SIZE_FORMAT ")\n",
 628                             name, value, aligned_max);
 629     return Flag::VIOLATES_CONSTRAINT;
 630   }
 631   return Flag::SUCCESS;
 632 }
 633 
 634 static Flag::Error MaxSizeForHeapAlignment(const char* name, size_t value, bool verbose) {
 635   // For G1 GC, we don't know until G1CollectorPolicy is created.
 636   size_t heap_alignment;
 637 
 638 #if INCLUDE_ALL_GCS
 639   if (UseG1GC) {
 640     heap_alignment = HeapRegionBounds::max_size();
 641   } else




 590         CommandLineError::print(verbose,
 591                                 "GCPauseIntervalMillis cannot be set "
 592                                 "without setting MaxGCPauseMillis\n");
 593         return Flag::VIOLATES_CONSTRAINT;
 594       }
 595 
 596       if (value <= MaxGCPauseMillis) {
 597         CommandLineError::print(verbose,
 598                                 "GCPauseIntervalMillis (" UINTX_FORMAT ") must be "
 599                                 "greater than MaxGCPauseMillis (" UINTX_FORMAT ")\n",
 600                                 value, MaxGCPauseMillis);
 601         return Flag::VIOLATES_CONSTRAINT;
 602       }
 603     }
 604   }
 605 #endif
 606   return Flag::SUCCESS;
 607 }
 608 
 609 Flag::Error InitialBootClassLoaderMetaspaceSizeConstraintFunc(size_t value, bool verbose) {
 610   size_t aligned_max = align_down(max_uintx/2, Metaspace::reserve_alignment_words());
 611   if (value > aligned_max) {
 612     CommandLineError::print(verbose,
 613                             "InitialBootClassLoaderMetaspaceSize (" SIZE_FORMAT ") must be "
 614                             "less than or equal to aligned maximum value (" SIZE_FORMAT ")\n",
 615                             value, aligned_max);
 616     return Flag::VIOLATES_CONSTRAINT;
 617   }
 618   return Flag::SUCCESS;
 619 }
 620 
 621 // To avoid an overflow by 'align_up(value, alignment)'.
 622 static Flag::Error MaxSizeForAlignment(const char* name, size_t value, size_t alignment, bool verbose) {
 623   size_t aligned_max = ((max_uintx - alignment) & ~(alignment-1));
 624   if (value > aligned_max) {
 625     CommandLineError::print(verbose,
 626                             "%s (" SIZE_FORMAT ") must be "
 627                             "less than or equal to aligned maximum value (" SIZE_FORMAT ")\n",
 628                             name, value, aligned_max);
 629     return Flag::VIOLATES_CONSTRAINT;
 630   }
 631   return Flag::SUCCESS;
 632 }
 633 
 634 static Flag::Error MaxSizeForHeapAlignment(const char* name, size_t value, bool verbose) {
 635   // For G1 GC, we don't know until G1CollectorPolicy is created.
 636   size_t heap_alignment;
 637 
 638 #if INCLUDE_ALL_GCS
 639   if (UseG1GC) {
 640     heap_alignment = HeapRegionBounds::max_size();
 641   } else


< prev index next >