< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page




1648   // OldPLABSize is interpreted in CMS as not the size of the PLAB in words,
1649   // but rather the number of free blocks of a given size that are used when
1650   // replenishing the local per-worker free list caches.
1651   if (FLAG_IS_DEFAULT(OldPLABSize)) {
1652     if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
1653       // OldPLAB sizing manually turned off: Use a larger default setting,
1654       // unless it was manually specified. This is because a too-low value
1655       // will slow down scavenges.
1656       FLAG_SET_ERGO(size_t, OldPLABSize, CompactibleFreeListSpaceLAB::_default_static_old_plab_size); // default value before 6631166
1657     } else {
1658       FLAG_SET_DEFAULT(OldPLABSize, CompactibleFreeListSpaceLAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default
1659     }
1660   }
1661 
1662   // If either of the static initialization defaults have changed, note this
1663   // modification.
1664   if (!FLAG_IS_DEFAULT(OldPLABSize) || !FLAG_IS_DEFAULT(OldPLABWeight)) {
1665     CompactibleFreeListSpaceLAB::modify_initialization(OldPLABSize, OldPLABWeight);
1666   }
1667 
1668   if (!ClassUnloading) {
1669     FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false);
1670     FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false);
1671   }
1672 
1673   log_trace(gc)("MarkStackSize: %uk  MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
1674 }
1675 #endif // INCLUDE_ALL_GCS
1676 
1677 void set_object_alignment() {
1678   // Object alignment.
1679   assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2");
1680   MinObjAlignmentInBytes     = ObjectAlignmentInBytes;
1681   assert(MinObjAlignmentInBytes >= HeapWordsPerLong * HeapWordSize, "ObjectAlignmentInBytes value is too small");
1682   MinObjAlignment            = MinObjAlignmentInBytes / HeapWordSize;
1683   assert(MinObjAlignmentInBytes == MinObjAlignment * HeapWordSize, "ObjectAlignmentInBytes value is incorrect");
1684   MinObjAlignmentInBytesMask = MinObjAlignmentInBytes - 1;
1685 
1686   LogMinObjAlignmentInBytes  = exact_log2(ObjectAlignmentInBytes);
1687   LogMinObjAlignment         = LogMinObjAlignmentInBytes - LogHeapWordSize;
1688 
1689   // Oop encoding heap max
1690   OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes;
1691 
1692   if (SurvivorAlignmentInBytes == 0) {


1979 void Arguments::set_gc_specific_flags() {
1980 #if INCLUDE_ALL_GCS
1981   // Set per-collector flags
1982   if (UseParallelGC || UseParallelOldGC) {
1983     set_parallel_gc_flags();
1984   } else if (UseConcMarkSweepGC) {
1985     set_cms_and_parnew_gc_flags();
1986   } else if (UseG1GC) {
1987     set_g1_gc_flags();
1988   }
1989   if (AssumeMP && !UseSerialGC) {
1990     if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) {
1991       warning("If the number of processors is expected to increase from one, then"
1992               " you should configure the number of parallel GC threads appropriately"
1993               " using -XX:ParallelGCThreads=N");
1994     }
1995   }
1996   if (MinHeapFreeRatio == 100) {
1997     // Keeping the heap 100% free is hard ;-) so limit it to 99%.
1998     FLAG_SET_ERGO(uintx, MinHeapFreeRatio, 99);







1999   }
2000 #endif // INCLUDE_ALL_GCS
2001 }
2002 
2003 julong Arguments::limit_by_allocatable_memory(julong limit) {
2004   julong max_allocatable;
2005   julong result = limit;
2006   if (os::has_allocatable_memory_limit(&max_allocatable)) {
2007     result = MIN2(result, max_allocatable / MaxVirtMemFraction);
2008   }
2009   return result;
2010 }
2011 
2012 // Use static initialization to get the default before parsing
2013 static const size_t DefaultHeapBaseMinAddress = HeapBaseMinAddress;
2014 
2015 void Arguments::set_heap_size() {
2016   const julong phys_mem =
2017     FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
2018                             : (julong)MaxRAM;




1648   // OldPLABSize is interpreted in CMS as not the size of the PLAB in words,
1649   // but rather the number of free blocks of a given size that are used when
1650   // replenishing the local per-worker free list caches.
1651   if (FLAG_IS_DEFAULT(OldPLABSize)) {
1652     if (!FLAG_IS_DEFAULT(ResizeOldPLAB) && !ResizeOldPLAB) {
1653       // OldPLAB sizing manually turned off: Use a larger default setting,
1654       // unless it was manually specified. This is because a too-low value
1655       // will slow down scavenges.
1656       FLAG_SET_ERGO(size_t, OldPLABSize, CompactibleFreeListSpaceLAB::_default_static_old_plab_size); // default value before 6631166
1657     } else {
1658       FLAG_SET_DEFAULT(OldPLABSize, CompactibleFreeListSpaceLAB::_default_dynamic_old_plab_size); // old CMSParPromoteBlocksToClaim default
1659     }
1660   }
1661 
1662   // If either of the static initialization defaults have changed, note this
1663   // modification.
1664   if (!FLAG_IS_DEFAULT(OldPLABSize) || !FLAG_IS_DEFAULT(OldPLABWeight)) {
1665     CompactibleFreeListSpaceLAB::modify_initialization(OldPLABSize, OldPLABWeight);
1666   }
1667 





1668   log_trace(gc)("MarkStackSize: %uk  MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K));
1669 }
1670 #endif // INCLUDE_ALL_GCS
1671 
1672 void set_object_alignment() {
1673   // Object alignment.
1674   assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2");
1675   MinObjAlignmentInBytes     = ObjectAlignmentInBytes;
1676   assert(MinObjAlignmentInBytes >= HeapWordsPerLong * HeapWordSize, "ObjectAlignmentInBytes value is too small");
1677   MinObjAlignment            = MinObjAlignmentInBytes / HeapWordSize;
1678   assert(MinObjAlignmentInBytes == MinObjAlignment * HeapWordSize, "ObjectAlignmentInBytes value is incorrect");
1679   MinObjAlignmentInBytesMask = MinObjAlignmentInBytes - 1;
1680 
1681   LogMinObjAlignmentInBytes  = exact_log2(ObjectAlignmentInBytes);
1682   LogMinObjAlignment         = LogMinObjAlignmentInBytes - LogHeapWordSize;
1683 
1684   // Oop encoding heap max
1685   OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes;
1686 
1687   if (SurvivorAlignmentInBytes == 0) {


1974 void Arguments::set_gc_specific_flags() {
1975 #if INCLUDE_ALL_GCS
1976   // Set per-collector flags
1977   if (UseParallelGC || UseParallelOldGC) {
1978     set_parallel_gc_flags();
1979   } else if (UseConcMarkSweepGC) {
1980     set_cms_and_parnew_gc_flags();
1981   } else if (UseG1GC) {
1982     set_g1_gc_flags();
1983   }
1984   if (AssumeMP && !UseSerialGC) {
1985     if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) {
1986       warning("If the number of processors is expected to increase from one, then"
1987               " you should configure the number of parallel GC threads appropriately"
1988               " using -XX:ParallelGCThreads=N");
1989     }
1990   }
1991   if (MinHeapFreeRatio == 100) {
1992     // Keeping the heap 100% free is hard ;-) so limit it to 99%.
1993     FLAG_SET_ERGO(uintx, MinHeapFreeRatio, 99);
1994   }
1995 
1996   // If class unloading is disabled, also disable concurrent class unloading.
1997   if (!ClassUnloading) {
1998     FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false);
1999     FLAG_SET_CMDLINE(bool, ClassUnloadingWithConcurrentMark, false);
2000     FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false);
2001   }
2002 #endif // INCLUDE_ALL_GCS
2003 }
2004 
2005 julong Arguments::limit_by_allocatable_memory(julong limit) {
2006   julong max_allocatable;
2007   julong result = limit;
2008   if (os::has_allocatable_memory_limit(&max_allocatable)) {
2009     result = MIN2(result, max_allocatable / MaxVirtMemFraction);
2010   }
2011   return result;
2012 }
2013 
2014 // Use static initialization to get the default before parsing
2015 static const size_t DefaultHeapBaseMinAddress = HeapBaseMinAddress;
2016 
2017 void Arguments::set_heap_size() {
2018   const julong phys_mem =
2019     FLAG_IS_DEFAULT(MaxRAM) ? MIN2(os::physical_memory(), (julong)MaxRAM)
2020                             : (julong)MaxRAM;


< prev index next >