Mercurial > hg > truffle
comparison src/share/vm/runtime/globals.hpp @ 10287:12f651e29f6b
6843347: Boundary values in some public GC options cause crashes
Summary: Setting some public integer options to specific values causes crashes or undefined GC behavior. This patchset adds the necessary argument checking for these options.
Reviewed-by: jmasa, brutisso
author | tschatzl |
---|---|
date | Wed, 15 May 2013 11:05:09 +0200 |
parents | d17700c82d7d |
children | 2958af1d8c5a |
comparison
equal
deleted
inserted
replaced
10286:0a2986f36965 | 10287:12f651e29f6b |
---|---|
284 CounterSetting(intx* cnt) { counter = cnt; (*counter)++; } | 284 CounterSetting(intx* cnt) { counter = cnt; (*counter)++; } |
285 ~CounterSetting() { (*counter)--; } | 285 ~CounterSetting() { (*counter)--; } |
286 }; | 286 }; |
287 | 287 |
288 | 288 |
289 class IntFlagSetting { | 289 class UIntFlagSetting { |
290 intx val; | 290 uintx val; |
291 intx* flag; | 291 uintx* flag; |
292 public: | 292 public: |
293 IntFlagSetting(intx& fl, intx newValue) { flag = &fl; val = fl; fl = newValue; } | 293 UIntFlagSetting(uintx& fl, uintx newValue) { flag = &fl; val = fl; fl = newValue; } |
294 ~IntFlagSetting() { *flag = val; } | 294 ~UIntFlagSetting() { *flag = val; } |
295 }; | 295 }; |
296 | 296 |
297 | 297 |
298 class DoubleFlagSetting { | 298 class DoubleFlagSetting { |
299 double val; | 299 double val; |
511 "Granularity to use for NUMA interleaving on Windows OS") \ | 511 "Granularity to use for NUMA interleaving on Windows OS") \ |
512 \ | 512 \ |
513 product(bool, ForceNUMA, false, \ | 513 product(bool, ForceNUMA, false, \ |
514 "Force NUMA optimizations on single-node/UMA systems") \ | 514 "Force NUMA optimizations on single-node/UMA systems") \ |
515 \ | 515 \ |
516 product(intx, NUMAChunkResizeWeight, 20, \ | 516 product(uintx, NUMAChunkResizeWeight, 20, \ |
517 "Percentage (0-100) used to weight the current sample when " \ | 517 "Percentage (0-100) used to weigh the current sample when " \ |
518 "computing exponentially decaying average for " \ | 518 "computing exponentially decaying average for " \ |
519 "AdaptiveNUMAChunkSizing") \ | 519 "AdaptiveNUMAChunkSizing") \ |
520 \ | 520 \ |
521 product(intx, NUMASpaceResizeRate, 1*G, \ | 521 product(uintx, NUMASpaceResizeRate, 1*G, \ |
522 "Do not reallocate more that this amount per collection") \ | 522 "Do not reallocate more that this amount per collection") \ |
523 \ | 523 \ |
524 product(bool, UseAdaptiveNUMAChunkSizing, true, \ | 524 product(bool, UseAdaptiveNUMAChunkSizing, true, \ |
525 "Enable adaptive chunk sizing for NUMA") \ | 525 "Enable adaptive chunk sizing for NUMA") \ |
526 \ | 526 \ |
527 product(bool, NUMAStats, false, \ | 527 product(bool, NUMAStats, false, \ |
528 "Print NUMA stats in detailed heap information") \ | 528 "Print NUMA stats in detailed heap information") \ |
529 \ | 529 \ |
530 product(intx, NUMAPageScanRate, 256, \ | 530 product(uintx, NUMAPageScanRate, 256, \ |
531 "Maximum number of pages to include in the page scan procedure") \ | 531 "Maximum number of pages to include in the page scan procedure") \ |
532 \ | 532 \ |
533 product_pd(bool, NeedsDeoptSuspend, \ | 533 product_pd(bool, NeedsDeoptSuspend, \ |
534 "True for register window machines (sparc/ia64)") \ | 534 "True for register window machines (sparc/ia64)") \ |
535 \ | 535 \ |
713 "Bump the number of file descriptors to max in solaris.") \ | 713 "Bump the number of file descriptors to max in solaris.") \ |
714 \ | 714 \ |
715 diagnostic(bool, LogEvents, true, \ | 715 diagnostic(bool, LogEvents, true, \ |
716 "Enable the various ring buffer event logs") \ | 716 "Enable the various ring buffer event logs") \ |
717 \ | 717 \ |
718 diagnostic(intx, LogEventsBufferEntries, 10, \ | 718 diagnostic(uintx, LogEventsBufferEntries, 10, \ |
719 "Enable the various ring buffer event logs") \ | 719 "Enable the various ring buffer event logs") \ |
720 \ | 720 \ |
721 product(bool, BytecodeVerificationRemote, true, \ | 721 product(bool, BytecodeVerificationRemote, true, \ |
722 "Enables the Java bytecode verifier for remote classes") \ | 722 "Enables the Java bytecode verifier for remote classes") \ |
723 \ | 723 \ |
1430 "Use parallel threads in the new generation.") \ | 1430 "Use parallel threads in the new generation.") \ |
1431 \ | 1431 \ |
1432 product(bool, ParallelGCVerbose, false, \ | 1432 product(bool, ParallelGCVerbose, false, \ |
1433 "Verbose output for parallel GC.") \ | 1433 "Verbose output for parallel GC.") \ |
1434 \ | 1434 \ |
1435 product(intx, ParallelGCBufferWastePct, 10, \ | 1435 product(uintx, ParallelGCBufferWastePct, 10, \ |
1436 "wasted fraction of parallel allocation buffer.") \ | 1436 "Wasted fraction of parallel allocation buffer.") \ |
1437 \ | 1437 \ |
1438 diagnostic(bool, ParallelGCRetainPLAB, false, \ | 1438 diagnostic(bool, ParallelGCRetainPLAB, false, \ |
1439 "Retain parallel allocation buffers across scavenges; " \ | 1439 "Retain parallel allocation buffers across scavenges; " \ |
1440 " -- disabled because this currently conflicts with " \ | 1440 " -- disabled because this currently conflicts with " \ |
1441 " parallel card scanning under certain conditions ") \ | 1441 " parallel card scanning under certain conditions ") \ |
1442 \ | 1442 \ |
1443 product(intx, TargetPLABWastePct, 10, \ | 1443 product(uintx, TargetPLABWastePct, 10, \ |
1444 "target wasted space in last buffer as pct of overall allocation")\ | 1444 "Target wasted space in last buffer as percent of overall " \ |
1445 "allocation") \ | |
1445 \ | 1446 \ |
1446 product(uintx, PLABWeight, 75, \ | 1447 product(uintx, PLABWeight, 75, \ |
1447 "Percentage (0-100) used to weight the current sample when" \ | 1448 "Percentage (0-100) used to weight the current sample when" \ |
1448 "computing exponentially decaying average for ResizePLAB.") \ | 1449 "computing exponentially decaying average for ResizePLAB.") \ |
1449 \ | 1450 \ |
1517 " during a scavenge") \ | 1518 " during a scavenge") \ |
1518 \ | 1519 \ |
1519 product(bool, AlwaysPreTouch, false, \ | 1520 product(bool, AlwaysPreTouch, false, \ |
1520 "It forces all freshly committed pages to be pre-touched.") \ | 1521 "It forces all freshly committed pages to be pre-touched.") \ |
1521 \ | 1522 \ |
1522 product_pd(intx, CMSYoungGenPerWorker, \ | 1523 product_pd(uintx, CMSYoungGenPerWorker, \ |
1523 "The maximum size of young gen chosen by default per GC worker " \ | 1524 "The maximum size of young gen chosen by default per GC worker " \ |
1524 "thread available") \ | 1525 "thread available") \ |
1525 \ | 1526 \ |
1526 product(bool, CMSIncrementalMode, false, \ | 1527 product(bool, CMSIncrementalMode, false, \ |
1527 "Whether CMS GC should operate in \"incremental\" mode") \ | 1528 "Whether CMS GC should operate in \"incremental\" mode") \ |
1835 "denotes 'do constant GC cycles'.") \ | 1836 "denotes 'do constant GC cycles'.") \ |
1836 \ | 1837 \ |
1837 product(bool, UseCMSInitiatingOccupancyOnly, false, \ | 1838 product(bool, UseCMSInitiatingOccupancyOnly, false, \ |
1838 "Only use occupancy as a crierion for starting a CMS collection") \ | 1839 "Only use occupancy as a crierion for starting a CMS collection") \ |
1839 \ | 1840 \ |
1840 product(intx, CMSIsTooFullPercentage, 98, \ | 1841 product(uintx, CMSIsTooFullPercentage, 98, \ |
1841 "An absolute ceiling above which CMS will always consider the " \ | 1842 "An absolute ceiling above which CMS will always consider the " \ |
1842 "unloading of classes when class unloading is enabled") \ | 1843 "unloading of classes when class unloading is enabled") \ |
1843 \ | 1844 \ |
1844 develop(bool, CMSTestInFreeList, false, \ | 1845 develop(bool, CMSTestInFreeList, false, \ |
1845 "Check if the coalesced range is already in the " \ | 1846 "Check if the coalesced range is already in the " \ |
1874 "(other young collectors) ") \ | 1875 "(other young collectors) ") \ |
1875 \ | 1876 \ |
1876 develop(uintx, PromotionFailureALotInterval, 5, \ | 1877 develop(uintx, PromotionFailureALotInterval, 5, \ |
1877 "Total collections between promotion failures alot") \ | 1878 "Total collections between promotion failures alot") \ |
1878 \ | 1879 \ |
1879 experimental(intx, WorkStealingSleepMillis, 1, \ | 1880 experimental(uintx, WorkStealingSleepMillis, 1, \ |
1880 "Sleep time when sleep is used for yields") \ | 1881 "Sleep time when sleep is used for yields") \ |
1881 \ | 1882 \ |
1882 experimental(uintx, WorkStealingYieldsBeforeSleep, 5000, \ | 1883 experimental(uintx, WorkStealingYieldsBeforeSleep, 5000, \ |
1883 "Number of yields before a sleep is done during workstealing") \ | 1884 "Number of yields before a sleep is done during workstealing") \ |
1884 \ | 1885 \ |
2018 \ | 2019 \ |
2019 develop(uintx, AdaptiveSizePolicyReadyThreshold, 5, \ | 2020 develop(uintx, AdaptiveSizePolicyReadyThreshold, 5, \ |
2020 "Number of collections before the adaptive sizing is started") \ | 2021 "Number of collections before the adaptive sizing is started") \ |
2021 \ | 2022 \ |
2022 product(uintx, AdaptiveSizePolicyOutputInterval, 0, \ | 2023 product(uintx, AdaptiveSizePolicyOutputInterval, 0, \ |
2023 "Collecton interval for printing information; zero => never") \ | 2024 "Collection interval for printing information; zero means never") \ |
2024 \ | 2025 \ |
2025 product(bool, UseAdaptiveSizePolicyFootprintGoal, true, \ | 2026 product(bool, UseAdaptiveSizePolicyFootprintGoal, true, \ |
2026 "Use adaptive minimum footprint as a goal") \ | 2027 "Use adaptive minimum footprint as a goal") \ |
2027 \ | 2028 \ |
2028 product(uintx, AdaptiveSizePolicyWeight, 10, \ | 2029 product(uintx, AdaptiveSizePolicyWeight, 10, \ |
3047 "Max percentage of Metaspace free after GC to avoid shrinking") \ | 3048 "Max percentage of Metaspace free after GC to avoid shrinking") \ |
3048 \ | 3049 \ |
3049 product(uintx, MaxMetaspaceExpansion, ScaleForWordSize(4*M), \ | 3050 product(uintx, MaxMetaspaceExpansion, ScaleForWordSize(4*M), \ |
3050 "Max expansion of Metaspace without full GC (in bytes)") \ | 3051 "Max expansion of Metaspace without full GC (in bytes)") \ |
3051 \ | 3052 \ |
3052 product(intx, QueuedAllocationWarningCount, 0, \ | 3053 product(uintx, QueuedAllocationWarningCount, 0, \ |
3053 "Number of times an allocation that queues behind a GC " \ | 3054 "Number of times an allocation that queues behind a GC " \ |
3054 "will retry before printing a warning") \ | 3055 "will retry before printing a warning") \ |
3055 \ | 3056 \ |
3056 diagnostic(uintx, VerifyGCStartAt, 0, \ | 3057 diagnostic(uintx, VerifyGCStartAt, 0, \ |
3057 "GC invoke count where +VerifyBefore/AfterGC kicks in") \ | 3058 "GC invoke count where +VerifyBefore/AfterGC kicks in") \ |
3075 "Par compact uses a variable scale based on the density of the" \ | 3076 "Par compact uses a variable scale based on the density of the" \ |
3076 "generation and treats this as the max value when the heap is" \ | 3077 "generation and treats this as the max value when the heap is" \ |
3077 "either completely full or completely empty. Par compact also" \ | 3078 "either completely full or completely empty. Par compact also" \ |
3078 "has a smaller default value; see arguments.cpp.") \ | 3079 "has a smaller default value; see arguments.cpp.") \ |
3079 \ | 3080 \ |
3080 product(intx, MarkSweepAlwaysCompactCount, 4, \ | 3081 product(uintx, MarkSweepAlwaysCompactCount, 4, \ |
3081 "How often should we fully compact the heap (ignoring the dead " \ | 3082 "How often should we fully compact the heap (ignoring the dead " \ |
3082 "space parameters)") \ | 3083 "space parameters)") \ |
3083 \ | 3084 \ |
3084 product(intx, PrintCMSStatistics, 0, \ | 3085 product(intx, PrintCMSStatistics, 0, \ |
3085 "Statistics for CMS") \ | 3086 "Statistics for CMS") \ |