src/share/vm/runtime/commandLineFlagConstraintsGC.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8112746_open Sdiff src/share/vm/runtime

src/share/vm/runtime/commandLineFlagConstraintsGC.cpp

Print this page




  80   }
  81 }
  82 
  83 Flag::Error MaxMetaspaceFreeRatioConstraintFunc(bool verbose, uintx* value) {
  84   if ((CommandLineFlags::finishedInitializing()) && (*value < MinMetaspaceFreeRatio)) {
  85     if (verbose == true) {
  86       jio_fprintf(defaultStream::error_stream(),
  87                   "MaxMetaspaceFreeRatio (" UINTX_FORMAT ") must be greater than or "
  88                   "equal to MinMetaspaceFreeRatio (" UINTX_FORMAT ")\n",
  89                   *value, MinMetaspaceFreeRatio);
  90     }
  91     return Flag::VIOLATES_CONSTRAINT;
  92   } else {
  93     return Flag::SUCCESS;
  94   }
  95 }
  96 
  97 // GC workaround for "-XX:+UseConcMarkSweepGC"
  98 // which sets InitialTenuringThreshold to 7 but leaves MaxTenuringThreshold remaining at 6
  99 // and therefore would invalidate the constraint
 100 #define UseConcMarkSweepGCWorkaroundIfNeeded(initial, max) { \

 101   if ((initial == 7) && (max == 6)) { \
 102     return Flag::SUCCESS; \
 103   } \
 104 }
 105 
 106 Flag::Error InitialTenuringThresholdConstraintFunc(bool verbose, uintx* value) {
 107   UseConcMarkSweepGCWorkaroundIfNeeded(*value, MaxTenuringThreshold);
 108 
 109   if ((CommandLineFlags::finishedInitializing()) && (*value > MaxTenuringThreshold)) {
 110     if (verbose == true) {
 111       jio_fprintf(defaultStream::error_stream(),
 112                   "InitialTenuringThreshold (" UINTX_FORMAT ") must be less than or "
 113                   "equal to MaxTenuringThreshold (" UINTX_FORMAT ")\n",
 114                   *value, MaxTenuringThreshold);
 115     }
 116     return Flag::VIOLATES_CONSTRAINT;
 117   } else {
 118     return Flag::SUCCESS;
 119   }
 120 }
 121 
 122 Flag::Error MaxTenuringThresholdConstraintFunc(bool verbose, uintx* value) {
 123   UseConcMarkSweepGCWorkaroundIfNeeded(InitialTenuringThreshold, *value);
 124 




  80   }
  81 }
  82 
  83 Flag::Error MaxMetaspaceFreeRatioConstraintFunc(bool verbose, uintx* value) {
  84   if ((CommandLineFlags::finishedInitializing()) && (*value < MinMetaspaceFreeRatio)) {
  85     if (verbose == true) {
  86       jio_fprintf(defaultStream::error_stream(),
  87                   "MaxMetaspaceFreeRatio (" UINTX_FORMAT ") must be greater than or "
  88                   "equal to MinMetaspaceFreeRatio (" UINTX_FORMAT ")\n",
  89                   *value, MinMetaspaceFreeRatio);
  90     }
  91     return Flag::VIOLATES_CONSTRAINT;
  92   } else {
  93     return Flag::SUCCESS;
  94   }
  95 }
  96 
  97 // GC workaround for "-XX:+UseConcMarkSweepGC"
  98 // which sets InitialTenuringThreshold to 7 but leaves MaxTenuringThreshold remaining at 6
  99 // and therefore would invalidate the constraint
 100 #define UseConcMarkSweepGCWorkaroundIfNeeded(initial, max) \
 101 do { \
 102   if ((initial == 7) && (max == 6)) { \
 103     return Flag::SUCCESS; \
 104   } \
 105 } while (0)
 106 
 107 Flag::Error InitialTenuringThresholdConstraintFunc(bool verbose, uintx* value) {
 108   UseConcMarkSweepGCWorkaroundIfNeeded(*value, MaxTenuringThreshold);
 109 
 110   if ((CommandLineFlags::finishedInitializing()) && (*value > MaxTenuringThreshold)) {
 111     if (verbose == true) {
 112       jio_fprintf(defaultStream::error_stream(),
 113                   "InitialTenuringThreshold (" UINTX_FORMAT ") must be less than or "
 114                   "equal to MaxTenuringThreshold (" UINTX_FORMAT ")\n",
 115                   *value, MaxTenuringThreshold);
 116     }
 117     return Flag::VIOLATES_CONSTRAINT;
 118   } else {
 119     return Flag::SUCCESS;
 120   }
 121 }
 122 
 123 Flag::Error MaxTenuringThresholdConstraintFunc(bool verbose, uintx* value) {
 124   UseConcMarkSweepGCWorkaroundIfNeeded(InitialTenuringThreshold, *value);
 125 


src/share/vm/runtime/commandLineFlagConstraintsGC.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File