< prev index next >

src/share/vm/runtime/commandLineFlagConstraintsGC.cpp

Print this page




  97 }
  98 
  99 // As ConcGCThreads should be smaller than ParallelGCThreads,
 100 // we need constraint function.
 101 Flag::Error ConcGCThreadsConstraintFunc(uint value, bool verbose) {
 102 #if INCLUDE_ALL_GCS
 103   // CMS and G1 GCs use ConcGCThreads.
 104   if ((UseConcMarkSweepGC || UseG1GC) && (value > ParallelGCThreads)) {
 105     CommandLineError::print(verbose,
 106                             "ConcGCThreads (" UINT32_FORMAT ") must be "
 107                             "less than or equal to ParallelGCThreads (" UINT32_FORMAT ")\n",
 108                             value, ParallelGCThreads);
 109     return Flag::VIOLATES_CONSTRAINT;
 110   }
 111 #endif
 112   return Flag::SUCCESS;
 113 }
 114 
 115 static Flag::Error MinPLABSizeBounds(const char* name, size_t value, bool verbose) {
 116 #if INCLUDE_ALL_GCS
 117   if ((UseConcMarkSweepGC || UseG1GC) && (value < PLAB::min_size())) {
 118     CommandLineError::print(verbose,
 119                             "%s (" SIZE_FORMAT ") must be "
 120                             "greater than or equal to ergonomic PLAB minimum size (" SIZE_FORMAT ")\n",
 121                             name, value, PLAB::min_size());
 122     return Flag::VIOLATES_CONSTRAINT;
 123   }
 124 #endif // INCLUDE_ALL_GCS
 125   return Flag::SUCCESS;
 126 }
 127 
 128 static Flag::Error MaxPLABSizeBounds(const char* name, size_t value, bool verbose) {
 129 #if INCLUDE_ALL_GCS
 130   if ((UseConcMarkSweepGC || UseG1GC) && (value > PLAB::max_size())) {
 131     CommandLineError::print(verbose,
 132                             "%s (" SIZE_FORMAT ") must be "
 133                             "less than or equal to ergonomic PLAB maximum size (" SIZE_FORMAT ")\n",
 134                             name, value, PLAB::max_size());
 135     return Flag::VIOLATES_CONSTRAINT;
 136   }
 137 #endif // INCLUDE_ALL_GCS
 138   return Flag::SUCCESS;
 139 }
 140 
 141 static Flag::Error MinMaxPLABSizeBounds(const char* name, size_t value, bool verbose) {
 142   Flag::Error status = MinPLABSizeBounds(name, value, verbose);
 143 
 144   if (status == Flag::SUCCESS) {
 145     return MaxPLABSizeBounds(name, value, verbose);
 146   }
 147   return status;
 148 }
 149 
 150 Flag::Error YoungPLABSizeConstraintFunc(size_t value, bool verbose) {




  97 }
  98 
  99 // As ConcGCThreads should be smaller than ParallelGCThreads,
 100 // we need constraint function.
 101 Flag::Error ConcGCThreadsConstraintFunc(uint value, bool verbose) {
 102 #if INCLUDE_ALL_GCS
 103   // CMS and G1 GCs use ConcGCThreads.
 104   if ((UseConcMarkSweepGC || UseG1GC) && (value > ParallelGCThreads)) {
 105     CommandLineError::print(verbose,
 106                             "ConcGCThreads (" UINT32_FORMAT ") must be "
 107                             "less than or equal to ParallelGCThreads (" UINT32_FORMAT ")\n",
 108                             value, ParallelGCThreads);
 109     return Flag::VIOLATES_CONSTRAINT;
 110   }
 111 #endif
 112   return Flag::SUCCESS;
 113 }
 114 
 115 static Flag::Error MinPLABSizeBounds(const char* name, size_t value, bool verbose) {
 116 #if INCLUDE_ALL_GCS
 117   if ((UseConcMarkSweepGC || UseG1GC || UseParallelGC) && (value < PLAB::min_size())) {
 118     CommandLineError::print(verbose,
 119                             "%s (" SIZE_FORMAT ") must be "
 120                             "greater than or equal to ergonomic PLAB minimum size (" SIZE_FORMAT ")\n",
 121                             name, value, PLAB::min_size());
 122     return Flag::VIOLATES_CONSTRAINT;
 123   }
 124 #endif // INCLUDE_ALL_GCS
 125   return Flag::SUCCESS;
 126 }
 127 
 128 static Flag::Error MaxPLABSizeBounds(const char* name, size_t value, bool verbose) {
 129 #if INCLUDE_ALL_GCS
 130   if ((UseConcMarkSweepGC || UseG1GC || UseParallelGC) && (value > PLAB::max_size())) {
 131     CommandLineError::print(verbose,
 132                             "%s (" SIZE_FORMAT ") must be "
 133                             "less than or equal to ergonomic PLAB maximum size (" SIZE_FORMAT ")\n",
 134                             name, value, PLAB::max_size());
 135     return Flag::VIOLATES_CONSTRAINT;
 136   }
 137 #endif // INCLUDE_ALL_GCS
 138   return Flag::SUCCESS;
 139 }
 140 
 141 static Flag::Error MinMaxPLABSizeBounds(const char* name, size_t value, bool verbose) {
 142   Flag::Error status = MinPLABSizeBounds(name, value, verbose);
 143 
 144   if (status == Flag::SUCCESS) {
 145     return MaxPLABSizeBounds(name, value, verbose);
 146   }
 147   return status;
 148 }
 149 
 150 Flag::Error YoungPLABSizeConstraintFunc(size_t value, bool verbose) {


< prev index next >