hotspot/src/share/vm/runtime/globals.hpp
changeset 31995 aa4049b4184a
parent 31989 3ba773bbacbe
child 31996 6c23ab90cbaa
equal deleted inserted replaced
31994:3721b7aa3a0d 31995:aa4049b4184a
   448   ~SizeTFlagSetting()                           { *flag = val; }
   448   ~SizeTFlagSetting()                           { *flag = val; }
   449 };
   449 };
   450 
   450 
   451 
   451 
   452 class CommandLineFlags {
   452 class CommandLineFlags {
   453   static bool _finished_initializing;
       
   454 public:
   453 public:
   455   static Flag::Error boolAt(const char* name, size_t len, bool* value, bool allow_locked = false, bool return_flag = false);
   454   static Flag::Error boolAt(const char* name, size_t len, bool* value, bool allow_locked = false, bool return_flag = false);
   456   static Flag::Error boolAt(const char* name, bool* value, bool allow_locked = false, bool return_flag = false)      { return boolAt(name, strlen(name), value, allow_locked, return_flag); }
   455   static Flag::Error boolAt(const char* name, bool* value, bool allow_locked = false, bool return_flag = false)      { return boolAt(name, strlen(name), value, allow_locked, return_flag); }
   457   static Flag::Error boolAtPut(const char* name, size_t len, bool* value, Flag::Flags origin);
   456   static Flag::Error boolAtPut(const char* name, size_t len, bool* value, Flag::Flags origin);
   458   static Flag::Error boolAtPut(const char* name, bool* value, Flag::Flags origin)   { return boolAtPut(name, strlen(name), value, origin); }
   457   static Flag::Error boolAtPut(const char* name, bool* value, Flag::Flags origin)   { return boolAtPut(name, strlen(name), value, origin); }
   503   static bool wasSetOnCmdline(const char* name, bool* value);
   502   static bool wasSetOnCmdline(const char* name, bool* value);
   504   static void printSetFlags(outputStream* out);
   503   static void printSetFlags(outputStream* out);
   505 
   504 
   506   // printRanges will print out flags type, name and range values as expected by -XX:+PrintFlagsRanges
   505   // printRanges will print out flags type, name and range values as expected by -XX:+PrintFlagsRanges
   507   static void printFlags(outputStream* out, bool withComments, bool printRanges = false);
   506   static void printFlags(outputStream* out, bool withComments, bool printRanges = false);
   508 
       
   509   // Returns true if all flags have their final values set (ready for ranges and constraint check)
       
   510   static bool finishedInitializing() { return _finished_initializing; }
       
   511 
       
   512   // Check the final values of all flags for ranges and constraints
       
   513   static bool check_all_ranges_and_constraints();
       
   514 
   507 
   515   static void verify() PRODUCT_RETURN;
   508   static void verify() PRODUCT_RETURN;
   516 };
   509 };
   517 
   510 
   518 // use this for flags that are true by default in the debug version but
   511 // use this for flags that are true by default in the debug version but
   638           "Print compressed oops base address and encoding mode")           \
   631           "Print compressed oops base address and encoding mode")           \
   639                                                                             \
   632                                                                             \
   640   lp64_product(intx, ObjectAlignmentInBytes, 8,                             \
   633   lp64_product(intx, ObjectAlignmentInBytes, 8,                             \
   641           "Default object alignment in bytes, 8 is minimum")                \
   634           "Default object alignment in bytes, 8 is minimum")                \
   642           range(8, 256)                                                     \
   635           range(8, 256)                                                     \
   643           constraint(ObjectAlignmentInBytesConstraintFunc)                  \
   636           constraint(ObjectAlignmentInBytesConstraintFunc,AtParse)          \
   644                                                                             \
   637                                                                             \
   645   product(bool, AssumeMP, false,                                            \
   638   product(bool, AssumeMP, false,                                            \
   646           "Instruct the VM to assume multiple processors are available")    \
   639           "Instruct the VM to assume multiple processors are available")    \
   647                                                                             \
   640                                                                             \
   648   /* UseMembar is theoretically a temp flag used for memory barrier      */ \
   641   /* UseMembar is theoretically a temp flag used for memory barrier      */ \
  1394   /* aggressive prefetching, while still leaving the room for segregating */\
  1387   /* aggressive prefetching, while still leaving the room for segregating */\
  1395   /* among the distinct pages.                                            */\
  1388   /* among the distinct pages.                                            */\
  1396   product(intx, ContendedPaddingWidth, 128,                                 \
  1389   product(intx, ContendedPaddingWidth, 128,                                 \
  1397           "How many bytes to pad the fields/classes marked @Contended with")\
  1390           "How many bytes to pad the fields/classes marked @Contended with")\
  1398           range(0, 8192)                                                    \
  1391           range(0, 8192)                                                    \
  1399           constraint(ContendedPaddingWidthConstraintFunc)                   \
  1392           constraint(ContendedPaddingWidthConstraintFunc,AtParse)           \
  1400                                                                             \
  1393                                                                             \
  1401   product(bool, EnableContended, true,                                      \
  1394   product(bool, EnableContended, true,                                      \
  1402           "Enable @Contended annotation support")                           \
  1395           "Enable @Contended annotation support")                           \
  1403                                                                             \
  1396                                                                             \
  1404   product(bool, RestrictContended, true,                                    \
  1397   product(bool, RestrictContended, true,                                    \
  1595   product(uint, ConcGCThreads, 0,                                           \
  1588   product(uint, ConcGCThreads, 0,                                           \
  1596           "Number of threads concurrent gc will use")                       \
  1589           "Number of threads concurrent gc will use")                       \
  1597                                                                             \
  1590                                                                             \
  1598   product(size_t, YoungPLABSize, 4096,                                      \
  1591   product(size_t, YoungPLABSize, 4096,                                      \
  1599           "Size of young gen promotion LAB's (in HeapWords)")               \
  1592           "Size of young gen promotion LAB's (in HeapWords)")               \
       
  1593           constraint(YoungPLABSizeConstraintFunc,AfterMemoryInit)           \
  1600                                                                             \
  1594                                                                             \
  1601   product(size_t, OldPLABSize, 1024,                                        \
  1595   product(size_t, OldPLABSize, 1024,                                        \
  1602           "Size of old gen promotion LAB's (in HeapWords), or Number        \
  1596           "Size of old gen promotion LAB's (in HeapWords), or Number        \
  1603           of blocks to attempt to claim when refilling CMS LAB's")          \
  1597           of blocks to attempt to claim when refilling CMS LAB's")          \
  1604                                                                             \
  1598                                                                             \
  1733                                                                             \
  1727                                                                             \
  1734   product(size_t, CMSOldPLABMin, 16,                                        \
  1728   product(size_t, CMSOldPLABMin, 16,                                        \
  1735           "Minimum size of CMS gen promotion LAB caches per worker "        \
  1729           "Minimum size of CMS gen promotion LAB caches per worker "        \
  1736           "per block size")                                                 \
  1730           "per block size")                                                 \
  1737           range(1, max_uintx)                                               \
  1731           range(1, max_uintx)                                               \
  1738           constraint(CMSOldPLABMinConstraintFunc)                           \
  1732           constraint(CMSOldPLABMinConstraintFunc,AfterErgo)                 \
  1739                                                                             \
  1733                                                                             \
  1740   product(uintx, CMSOldPLABNumRefills, 4,                                   \
  1734   product(uintx, CMSOldPLABNumRefills, 4,                                   \
  1741           "Nominal number of refills of CMS gen promotion LAB cache "       \
  1735           "Nominal number of refills of CMS gen promotion LAB cache "       \
  1742           "per worker per block size")                                      \
  1736           "per worker per block size")                                      \
  1743           range(1, max_uintx)                                               \
  1737           range(1, max_uintx)                                               \
  1929                                                                             \
  1923                                                                             \
  1930   product(uintx, CMSPrecleanDenominator, 3,                                 \
  1924   product(uintx, CMSPrecleanDenominator, 3,                                 \
  1931           "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \
  1925           "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \
  1932           "ratio")                                                          \
  1926           "ratio")                                                          \
  1933           range(1, max_uintx)                                               \
  1927           range(1, max_uintx)                                               \
  1934           constraint(CMSPrecleanDenominatorConstraintFunc)                  \
  1928           constraint(CMSPrecleanDenominatorConstraintFunc,AfterErgo)        \
  1935                                                                             \
  1929                                                                             \
  1936   product(uintx, CMSPrecleanNumerator, 2,                                   \
  1930   product(uintx, CMSPrecleanNumerator, 2,                                   \
  1937           "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \
  1931           "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \
  1938           "ratio")                                                          \
  1932           "ratio")                                                          \
  1939           range(0, max_uintx-1)                                             \
  1933           range(0, max_uintx-1)                                             \
  1940           constraint(CMSPrecleanNumeratorConstraintFunc)                    \
  1934           constraint(CMSPrecleanNumeratorConstraintFunc,AfterErgo)          \
  1941                                                                             \
  1935                                                                             \
  1942   product(bool, CMSPrecleanRefLists1, true,                                 \
  1936   product(bool, CMSPrecleanRefLists1, true,                                 \
  1943           "Preclean ref lists during (initial) preclean phase")             \
  1937           "Preclean ref lists during (initial) preclean phase")             \
  1944                                                                             \
  1938                                                                             \
  1945   product(bool, CMSPrecleanRefLists2, false,                                \
  1939   product(bool, CMSPrecleanRefLists2, false,                                \
  3359   manageable(uintx, MinHeapFreeRatio, 40,                                   \
  3353   manageable(uintx, MinHeapFreeRatio, 40,                                   \
  3360           "The minimum percentage of heap free after GC to avoid expansion."\
  3354           "The minimum percentage of heap free after GC to avoid expansion."\
  3361           " For most GCs this applies to the old generation. In G1 and"     \
  3355           " For most GCs this applies to the old generation. In G1 and"     \
  3362           " ParallelGC it applies to the whole heap.")                      \
  3356           " ParallelGC it applies to the whole heap.")                      \
  3363           range(0, 100)                                                     \
  3357           range(0, 100)                                                     \
  3364           constraint(MinHeapFreeRatioConstraintFunc)                        \
  3358           constraint(MinHeapFreeRatioConstraintFunc,AfterErgo)              \
  3365                                                                             \
  3359                                                                             \
  3366   manageable(uintx, MaxHeapFreeRatio, 70,                                   \
  3360   manageable(uintx, MaxHeapFreeRatio, 70,                                   \
  3367           "The maximum percentage of heap free after GC to avoid shrinking."\
  3361           "The maximum percentage of heap free after GC to avoid shrinking."\
  3368           " For most GCs this applies to the old generation. In G1 and"     \
  3362           " For most GCs this applies to the old generation. In G1 and"     \
  3369           " ParallelGC it applies to the whole heap.")                      \
  3363           " ParallelGC it applies to the whole heap.")                      \
  3370           range(0, 100)                                                     \
  3364           range(0, 100)                                                     \
  3371           constraint(MaxHeapFreeRatioConstraintFunc)                        \
  3365           constraint(MaxHeapFreeRatioConstraintFunc,AfterErgo)              \
  3372                                                                             \
  3366                                                                             \
  3373   product(intx, SoftRefLRUPolicyMSPerMB, 1000,                              \
  3367   product(intx, SoftRefLRUPolicyMSPerMB, 1000,                              \
  3374           "Number of milliseconds per MB of free space in the heap")        \
  3368           "Number of milliseconds per MB of free space in the heap")        \
  3375                                                                             \
  3369                                                                             \
  3376   product(size_t, MinHeapDeltaBytes, ScaleForWordSize(128*K),               \
  3370   product(size_t, MinHeapDeltaBytes, ScaleForWordSize(128*K),               \
  3381                                                                             \
  3375                                                                             \
  3382   product(uintx, MaxMetaspaceFreeRatio,    70,                              \
  3376   product(uintx, MaxMetaspaceFreeRatio,    70,                              \
  3383           "The maximum percentage of Metaspace free after GC to avoid "     \
  3377           "The maximum percentage of Metaspace free after GC to avoid "     \
  3384           "shrinking")                                                      \
  3378           "shrinking")                                                      \
  3385           range(0, 100)                                                     \
  3379           range(0, 100)                                                     \
  3386           constraint(MaxMetaspaceFreeRatioConstraintFunc)                   \
  3380           constraint(MaxMetaspaceFreeRatioConstraintFunc,AfterErgo)         \
  3387                                                                             \
  3381                                                                             \
  3388   product(uintx, MinMetaspaceFreeRatio,    40,                              \
  3382   product(uintx, MinMetaspaceFreeRatio,    40,                              \
  3389           "The minimum percentage of Metaspace free after GC to avoid "     \
  3383           "The minimum percentage of Metaspace free after GC to avoid "     \
  3390           "expansion")                                                      \
  3384           "expansion")                                                      \
  3391           range(0, 99)                                                      \
  3385           range(0, 99)                                                      \
  3392           constraint(MinMetaspaceFreeRatioConstraintFunc)                   \
  3386           constraint(MinMetaspaceFreeRatioConstraintFunc,AfterErgo)         \
  3393                                                                             \
  3387                                                                             \
  3394   product(size_t, MaxMetaspaceExpansion, ScaleForWordSize(4*M),             \
  3388   product(size_t, MaxMetaspaceExpansion, ScaleForWordSize(4*M),             \
  3395           "The maximum expansion of Metaspace without full GC (in bytes)")  \
  3389           "The maximum expansion of Metaspace without full GC (in bytes)")  \
  3396                                                                             \
  3390                                                                             \
  3397   product(uintx, QueuedAllocationWarningCount, 0,                           \
  3391   product(uintx, QueuedAllocationWarningCount, 0,                           \
  3405           "Generation level at which to start +VerifyBefore/AfterGC")       \
  3399           "Generation level at which to start +VerifyBefore/AfterGC")       \
  3406                                                                             \
  3400                                                                             \
  3407   product(uintx, MaxTenuringThreshold,    15,                               \
  3401   product(uintx, MaxTenuringThreshold,    15,                               \
  3408           "Maximum value for tenuring threshold")                           \
  3402           "Maximum value for tenuring threshold")                           \
  3409           range(0, markOopDesc::max_age + 1)                                \
  3403           range(0, markOopDesc::max_age + 1)                                \
  3410           constraint(MaxTenuringThresholdConstraintFunc)                    \
  3404           constraint(MaxTenuringThresholdConstraintFunc,AfterErgo)          \
  3411                                                                             \
  3405                                                                             \
  3412   product(uintx, InitialTenuringThreshold,    7,                            \
  3406   product(uintx, InitialTenuringThreshold,    7,                            \
  3413           "Initial value for tenuring threshold")                           \
  3407           "Initial value for tenuring threshold")                           \
  3414           range(0, markOopDesc::max_age + 1)                                \
  3408           range(0, markOopDesc::max_age + 1)                                \
  3415           constraint(InitialTenuringThresholdConstraintFunc)                \
  3409           constraint(InitialTenuringThresholdConstraintFunc,AfterErgo)      \
  3416                                                                             \
  3410                                                                             \
  3417   product(uintx, TargetSurvivorRatio,    50,                                \
  3411   product(uintx, TargetSurvivorRatio,    50,                                \
  3418           "Desired percentage of survivor space used after scavenge")       \
  3412           "Desired percentage of survivor space used after scavenge")       \
  3419           range(0, 100)                                                     \
  3413           range(0, 100)                                                     \
  3420                                                                             \
  3414                                                                             \
  4088   product(bool, PrintGCCause, true,                                         \
  4082   product(bool, PrintGCCause, true,                                         \
  4089           "Include GC cause in GC logging")                                 \
  4083           "Include GC cause in GC logging")                                 \
  4090                                                                             \
  4084                                                                             \
  4091   experimental(intx, SurvivorAlignmentInBytes, 0,                           \
  4085   experimental(intx, SurvivorAlignmentInBytes, 0,                           \
  4092            "Default survivor space alignment in bytes")                     \
  4086            "Default survivor space alignment in bytes")                     \
  4093            constraint(SurvivorAlignmentInBytesConstraintFunc)               \
  4087            constraint(SurvivorAlignmentInBytesConstraintFunc,AfterErgo)     \
  4094                                                                             \
  4088                                                                             \
  4095   product(bool , AllowNonVirtualCalls, false,                               \
  4089   product(bool , AllowNonVirtualCalls, false,                               \
  4096           "Obey the ACC_SUPER flag and allow invokenonvirtual calls")       \
  4090           "Obey the ACC_SUPER flag and allow invokenonvirtual calls")       \
  4097                                                                             \
  4091                                                                             \
  4098   product(ccstr, DumpLoadedClassList, NULL,                                 \
  4092   product(ccstr, DumpLoadedClassList, NULL,                                 \
  4192 #endif // _LP64
  4186 #endif // _LP64
  4193 
  4187 
  4194 // Only materialize src code for range checking when required, ignore otherwise
  4188 // Only materialize src code for range checking when required, ignore otherwise
  4195 #define IGNORE_RANGE(a, b)
  4189 #define IGNORE_RANGE(a, b)
  4196 // Only materialize src code for contraint checking when required, ignore otherwise
  4190 // Only materialize src code for contraint checking when required, ignore otherwise
  4197 #define IGNORE_CONSTRAINT(func)
  4191 #define IGNORE_CONSTRAINT(func,type)
  4198 
  4192 
  4199 RUNTIME_FLAGS(DECLARE_DEVELOPER_FLAG, \
  4193 RUNTIME_FLAGS(DECLARE_DEVELOPER_FLAG, \
  4200               DECLARE_PD_DEVELOPER_FLAG, \
  4194               DECLARE_PD_DEVELOPER_FLAG, \
  4201               DECLARE_PRODUCT_FLAG, \
  4195               DECLARE_PRODUCT_FLAG, \
  4202               DECLARE_PD_PRODUCT_FLAG, \
  4196               DECLARE_PD_PRODUCT_FLAG, \