< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page




 387   { "BytecodeVerificationRemote",   JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::undefined() },
 388 #endif
 389 
 390   { NULL, JDK_Version(0), JDK_Version(0) }
 391 };
 392 
 393 // Flags that are aliases for other flags.
 394 typedef struct {
 395   const char* alias_name;
 396   const char* real_name;
 397 } AliasedFlag;
 398 
 399 static AliasedFlag const aliased_jvm_flags[] = {
 400   { "DefaultMaxRAMFraction",    "MaxRAMFraction"    },
 401   { "CMSMarkStackSizeMax",      "MarkStackSizeMax"  },
 402   { "CMSMarkStackSize",         "MarkStackSize"     },
 403   { "G1MarkStackSize",          "MarkStackSize"     },
 404   { "ParallelMarkingThreads",   "ConcGCThreads"     },
 405   { "ParallelCMSThreads",       "ConcGCThreads"     },
 406   { "CreateMinidumpOnCrash",    "CreateCoredumpOnCrash" },

 407   { NULL, NULL}
 408 };
 409 
 410 // NOTE: A compatibility request will be necessary for each alias to be removed.
 411 static AliasedLoggingFlag const aliased_logging_flags[] = {
 412   { "PrintCompressedOopsMode",   LogLevel::Info,  true,  LOG_TAGS(gc, heap, coops) },
 413   { "TraceBiasedLocking",        LogLevel::Info,  true,  LOG_TAGS(biasedlocking) },
 414   { "TraceClassLoading",         LogLevel::Info,  true,  LOG_TAGS(classload) },
 415   { "TraceClassLoadingPreorder", LogLevel::Debug, true,  LOG_TAGS(classload, preorder) },
 416   { "TraceClassPaths",           LogLevel::Info,  true,  LOG_TAGS(classpath) },
 417   { "TraceClassResolution",      LogLevel::Debug, true,  LOG_TAGS(classresolve) },
 418   { "TraceClassUnloading",       LogLevel::Info,  true,  LOG_TAGS(classunload) },
 419   { "TraceExceptions",           LogLevel::Info,  true,  LOG_TAGS(exceptions) },
 420   { "TraceLoaderConstraints",    LogLevel::Info,  true,  LOG_TAGS(classload, constraints) },
 421   { "TraceMonitorInflation",     LogLevel::Debug, true,  LOG_TAGS(monitorinflation) },
 422   { "TraceSafepointCleanupTime", LogLevel::Info,  true,  LOG_TAGS(safepointcleanup) },
 423   { "TraceJVMTIObjectTagging",   LogLevel::Debug, true,  LOG_TAGS(jvmti, objecttagging) },
 424   { NULL,                        LogLevel::Off,   false, LOG_TAGS(_NO_TAG) }
 425 };
 426 


1808   // OldPLABSize is interpreted in CMS as not the size of the PLAB in words,
1809   // but rather the number of free blocks of a given size that are used when
1810   // replenishing the local per-worker free list caches.
1811   if (FLAG_IS_DEFAULT(OldPLABSize)) {
1812     if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
1813       // OldPLAB sizing manually turned off: Use a larger default setting,
1814       // unless it was manually specified. This is because a too-low value
1815       // will slow down scavenges.
1816       FLAG_SET_ERGO(size_t, OldPLABSize, CompactibleFreeListSpaceLAB::_default_static_old_plab_size); // default value before 6631166
1817     } else {
1818       FLAG_SET_DEFAULT(OldPLABSize, CompactibleFreeListSpaceLAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default
1819     }
1820   }
1821 
1822   // If either of the static initialization defaults have changed, note this
1823   // modification.
1824   if (!FLAG_IS_DEFAULT(OldPLABSize) || !FLAG_IS_DEFAULT(OldPLABWeight)) {
1825     CompactibleFreeListSpaceLAB::modify_initialization(OldPLABSize, OldPLABWeight);
1826   }
1827 
1828   if (!ClassUnloading) {
1829     FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false);
1830     FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false);
1831   }
1832 
1833   log_trace(gc)("MarkStackSize: %uk  MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
1834   log_trace(gc)("ConcGCThreads: %u", ConcGCThreads);
1835 }
1836 #endif // INCLUDE_ALL_GCS
1837 
1838 void set_object_alignment() {
1839   // Object alignment.
1840   assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2");
1841   MinObjAlignmentInBytes     = ObjectAlignmentInBytes;
1842   assert(MinObjAlignmentInBytes >= HeapWordsPerLong * HeapWordSize, "ObjectAlignmentInBytes value is too small");
1843   MinObjAlignment            = MinObjAlignmentInBytes / HeapWordSize;
1844   assert(MinObjAlignmentInBytes == MinObjAlignment * HeapWordSize, "ObjectAlignmentInBytes value is incorrect");
1845   MinObjAlignmentInBytesMask = MinObjAlignmentInBytes - 1;
1846 
1847   LogMinObjAlignmentInBytes  = exact_log2(ObjectAlignmentInBytes);
1848   LogMinObjAlignment         = LogMinObjAlignmentInBytes - LogHeapWordSize;
1849 
1850   // Oop encoding heap max
1851   OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes;
1852 


2146 #if INCLUDE_ALL_GCS
2147   // Set per-collector flags
2148   if (UseParallelGC || UseParallelOldGC) {
2149     set_parallel_gc_flags();
2150   } else if (UseConcMarkSweepGC) {
2151     set_cms_and_parnew_gc_flags();
2152   } else if (UseG1GC) {
2153     set_g1_gc_flags();
2154   }
2155   if (AssumeMP && !UseSerialGC) {
2156     if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) {
2157       warning("If the number of processors is expected to increase from one, then"
2158               " you should configure the number of parallel GC threads appropriately"
2159               " using -XX:ParallelGCThreads=N");
2160     }
2161   }
2162   if (MinHeapFreeRatio == 100) {
2163     // Keeping the heap 100% free is hard ;-) so limit it to 99%.
2164     FLAG_SET_ERGO(uintx, MinHeapFreeRatio, 99);
2165   }





2166 #endif // INCLUDE_ALL_GCS
2167 }
2168 
2169 julong Arguments::limit_by_allocatable_memory(julong limit) {
2170   julong max_allocatable;
2171   julong result = limit;
2172   if (os::has_allocatable_memory_limit(&max_allocatable)) {
2173     result = MIN2(result, max_allocatable / MaxVirtMemFraction);
2174   }
2175   return result;
2176 }
2177 
2178 // Use static initialization to get the default before parsing
2179 static const size_t DefaultHeapBaseMinAddress = HeapBaseMinAddress;
2180 
2181 void Arguments::set_heap_size() {
2182   const julong phys_mem =
2183     FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
2184                             : (julong)MaxRAM;
2185 




 387   { "BytecodeVerificationRemote",   JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::undefined() },
 388 #endif
 389 
 390   { NULL, JDK_Version(0), JDK_Version(0) }
 391 };
 392 
 393 // Flags that are aliases for other flags.
 394 typedef struct {
 395   const char* alias_name;
 396   const char* real_name;
 397 } AliasedFlag;
 398 
 399 static AliasedFlag const aliased_jvm_flags[] = {
 400   { "DefaultMaxRAMFraction",    "MaxRAMFraction"    },
 401   { "CMSMarkStackSizeMax",      "MarkStackSizeMax"  },
 402   { "CMSMarkStackSize",         "MarkStackSize"     },
 403   { "G1MarkStackSize",          "MarkStackSize"     },
 404   { "ParallelMarkingThreads",   "ConcGCThreads"     },
 405   { "ParallelCMSThreads",       "ConcGCThreads"     },
 406   { "CreateMinidumpOnCrash",    "CreateCoredumpOnCrash" },
 407   { "CMSClassUnloadingEnabled", "ClassUnloadingWithConcurrentMark" },
 408   { NULL, NULL}
 409 };
 410 
 411 // NOTE: A compatibility request will be necessary for each alias to be removed.
 412 static AliasedLoggingFlag const aliased_logging_flags[] = {
 413   { "PrintCompressedOopsMode",   LogLevel::Info,  true,  LOG_TAGS(gc, heap, coops) },
 414   { "TraceBiasedLocking",        LogLevel::Info,  true,  LOG_TAGS(biasedlocking) },
 415   { "TraceClassLoading",         LogLevel::Info,  true,  LOG_TAGS(classload) },
 416   { "TraceClassLoadingPreorder", LogLevel::Debug, true,  LOG_TAGS(classload, preorder) },
 417   { "TraceClassPaths",           LogLevel::Info,  true,  LOG_TAGS(classpath) },
 418   { "TraceClassResolution",      LogLevel::Debug, true,  LOG_TAGS(classresolve) },
 419   { "TraceClassUnloading",       LogLevel::Info,  true,  LOG_TAGS(classunload) },
 420   { "TraceExceptions",           LogLevel::Info,  true,  LOG_TAGS(exceptions) },
 421   { "TraceLoaderConstraints",    LogLevel::Info,  true,  LOG_TAGS(classload, constraints) },
 422   { "TraceMonitorInflation",     LogLevel::Debug, true,  LOG_TAGS(monitorinflation) },
 423   { "TraceSafepointCleanupTime", LogLevel::Info,  true,  LOG_TAGS(safepointcleanup) },
 424   { "TraceJVMTIObjectTagging",   LogLevel::Debug, true,  LOG_TAGS(jvmti, objecttagging) },
 425   { NULL,                        LogLevel::Off,   false, LOG_TAGS(_NO_TAG) }
 426 };
 427 


1809   // OldPLABSize is interpreted in CMS as not the size of the PLAB in words,
1810   // but rather the number of free blocks of a given size that are used when
1811   // replenishing the local per-worker free list caches.
1812   if (FLAG_IS_DEFAULT(OldPLABSize)) {
1813     if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
1814       // OldPLAB sizing manually turned off: Use a larger default setting,
1815       // unless it was manually specified. This is because a too-low value
1816       // will slow down scavenges.
1817       FLAG_SET_ERGO(size_t, OldPLABSize, CompactibleFreeListSpaceLAB::_default_static_old_plab_size); // default value before 6631166
1818     } else {
1819       FLAG_SET_DEFAULT(OldPLABSize, CompactibleFreeListSpaceLAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default
1820     }
1821   }
1822 
1823   // If either of the static initialization defaults have changed, note this
1824   // modification.
1825   if (!FLAG_IS_DEFAULT(OldPLABSize) || !FLAG_IS_DEFAULT(OldPLABWeight)) {
1826     CompactibleFreeListSpaceLAB::modify_initialization(OldPLABSize, OldPLABWeight);
1827   }
1828 





1829   log_trace(gc)("MarkStackSize: %uk  MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
1830   log_trace(gc)("ConcGCThreads: %u", ConcGCThreads);
1831 }
1832 #endif // INCLUDE_ALL_GCS
1833 
1834 void set_object_alignment() {
1835   // Object alignment.
1836   assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2");
1837   MinObjAlignmentInBytes     = ObjectAlignmentInBytes;
1838   assert(MinObjAlignmentInBytes >= HeapWordsPerLong * HeapWordSize, "ObjectAlignmentInBytes value is too small");
1839   MinObjAlignment            = MinObjAlignmentInBytes / HeapWordSize;
1840   assert(MinObjAlignmentInBytes == MinObjAlignment * HeapWordSize, "ObjectAlignmentInBytes value is incorrect");
1841   MinObjAlignmentInBytesMask = MinObjAlignmentInBytes - 1;
1842 
1843   LogMinObjAlignmentInBytes  = exact_log2(ObjectAlignmentInBytes);
1844   LogMinObjAlignment         = LogMinObjAlignmentInBytes - LogHeapWordSize;
1845 
1846   // Oop encoding heap max
1847   OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes;
1848 


2142 #if INCLUDE_ALL_GCS
2143   // Set per-collector flags
2144   if (UseParallelGC || UseParallelOldGC) {
2145     set_parallel_gc_flags();
2146   } else if (UseConcMarkSweepGC) {
2147     set_cms_and_parnew_gc_flags();
2148   } else if (UseG1GC) {
2149     set_g1_gc_flags();
2150   }
2151   if (AssumeMP && !UseSerialGC) {
2152     if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) {
2153       warning("If the number of processors is expected to increase from one, then"
2154               " you should configure the number of parallel GC threads appropriately"
2155               " using -XX:ParallelGCThreads=N");
2156     }
2157   }
2158   if (MinHeapFreeRatio == 100) {
2159     // Keeping the heap 100% free is hard ;-) so limit it to 99%.
2160     FLAG_SET_ERGO(uintx, MinHeapFreeRatio, 99);
2161   }
2162 
2163   if (!ClassUnloading) {
2164     FLAG_SET_CMDLINE(bool, ClassUnloadingWithConcurrentMark, false);
2165     FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false);
2166   }
2167 #endif // INCLUDE_ALL_GCS
2168 }
2169 
2170 julong Arguments::limit_by_allocatable_memory(julong limit) {
2171   julong max_allocatable;
2172   julong result = limit;
2173   if (os::has_allocatable_memory_limit(&max_allocatable)) {
2174     result = MIN2(result, max_allocatable / MaxVirtMemFraction);
2175   }
2176   return result;
2177 }
2178 
2179 // Use static initialization to get the default before parsing
2180 static const size_t DefaultHeapBaseMinAddress = HeapBaseMinAddress;
2181 
2182 void Arguments::set_heap_size() {
2183   const julong phys_mem =
2184     FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
2185                             : (julong)MaxRAM;
2186 


< prev index next >