< prev index next >

src/hotspot/share/gc/cms/cmsArguments.cpp

Print this page




  65   }
  66 
  67   // When using compressed oops, we use local overflow stacks,
  68   // rather than using a global overflow list chained through
  69   // the klass word of the object's pre-image.
  70   if (UseCompressedOops && !ParGCUseLocalOverflow) {
  71     if (!FLAG_IS_DEFAULT(ParGCUseLocalOverflow)) {
  72       warning("Forcing +ParGCUseLocalOverflow: needed if using compressed references");
  73     }
  74     FLAG_SET_DEFAULT(ParGCUseLocalOverflow, true);
  75   }
  76   assert(ParGCUseLocalOverflow || !UseCompressedOops, "Error");
  77 }
  78 
  79 // Adjust some sizes to suit CMS and/or ParNew needs; these work well on
  80 // sparc/solaris for certain applications, but would gain from
  81 // further optimization and tuning efforts, and would almost
  82 // certainly gain from analysis of platform and environment.
  83 void CMSArguments::initialize() {
  84   GCArguments::initialize();

  85   assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC, "Error");
  86   assert(UseConcMarkSweepGC, "CMS is expected to be on here");


























  87 
  88   // Set CMS global values
  89   CompactibleFreeListSpace::set_cms_values();
  90 
  91   // Turn off AdaptiveSizePolicy by default for cms until it is complete.
  92   disable_adaptive_size_policy("UseConcMarkSweepGC");
  93 
  94   set_parnew_gc_flags();
  95 
  96   size_t max_heap = align_down(MaxHeapSize,
  97                                CardTableRS::ct_max_alignment_constraint());
  98 
  99   // Now make adjustments for CMS
 100   intx   tenuring_default = (intx)6;
 101   size_t young_gen_per_worker = CMSYoungGenPerWorker;
 102 
 103   // Preferred young gen size for "short" pauses:
 104   // upper bound depends on # of threads and NewRatio.
 105   const size_t preferred_max_new_size_unaligned =
 106     MIN2(max_heap/(NewRatio+1), ScaleForWordSize(young_gen_per_worker * ParallelGCThreads));




  65   }
  66 
  67   // When using compressed oops, we use local overflow stacks,
  68   // rather than using a global overflow list chained through
  69   // the klass word of the object's pre-image.
  70   if (UseCompressedOops && !ParGCUseLocalOverflow) {
  71     if (!FLAG_IS_DEFAULT(ParGCUseLocalOverflow)) {
  72       warning("Forcing +ParGCUseLocalOverflow: needed if using compressed references");
  73     }
  74     FLAG_SET_DEFAULT(ParGCUseLocalOverflow, true);
  75   }
  76   assert(ParGCUseLocalOverflow || !UseCompressedOops, "Error");
  77 }
  78 
  79 // Adjust some sizes to suit CMS and/or ParNew needs; these work well on
  80 // sparc/solaris for certain applications, but would gain from
  81 // further optimization and tuning efforts, and would almost
  82 // certainly gain from analysis of platform and environment.
  83 void CMSArguments::initialize() {
  84   GCArguments::initialize();
  85 
  86   assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC, "Error");
  87   assert(UseConcMarkSweepGC, "CMS is expected to be on here");
  88 
  89   // CMS space iteration, which FLSVerifyAllHeapreferences entails,
  90   // insists that we hold the requisite locks so that the iteration is
  91   // MT-safe. For the verification at start-up and shut-down, we don't
  92   // yet have a good way of acquiring and releasing these locks,
  93   // which are not visible at the CollectedHeap level. We want to
  94   // be able to acquire these locks and then do the iteration rather
  95   // than just disable the lock verification. This will be fixed under
  96   // bug 4788986.
  97   if (UseConcMarkSweepGC && FLSVerifyAllHeapReferences) {
  98     if (VerifyDuringStartup) {
  99       warning("Heap verification at start-up disabled "
 100               "(due to current incompatibility with FLSVerifyAllHeapReferences)");
 101       VerifyDuringStartup = false; // Disable verification at start-up
 102     }
 103 
 104     if (VerifyBeforeExit) {
 105       warning("Heap verification at shutdown disabled "
 106               "(due to current incompatibility with FLSVerifyAllHeapReferences)");
 107       VerifyBeforeExit = false; // Disable verification at shutdown
 108     }
 109   }
 110 
 111   if (!ClassUnloading) {
 112     FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false);
 113   }
 114 
 115   // Set CMS global values
 116   CompactibleFreeListSpace::set_cms_values();
 117 
 118   // Turn off AdaptiveSizePolicy by default for cms until it is complete.
 119   disable_adaptive_size_policy("UseConcMarkSweepGC");
 120 
 121   set_parnew_gc_flags();
 122 
 123   size_t max_heap = align_down(MaxHeapSize,
 124                                CardTableRS::ct_max_alignment_constraint());
 125 
 126   // Now make adjustments for CMS
 127   intx   tenuring_default = (intx)6;
 128   size_t young_gen_per_worker = CMSYoungGenPerWorker;
 129 
 130   // Preferred young gen size for "short" pauses:
 131   // upper bound depends on # of threads and NewRatio.
 132   const size_t preferred_max_new_size_unaligned =
 133     MIN2(max_heap/(NewRatio+1), ScaleForWordSize(young_gen_per_worker * ParallelGCThreads));


< prev index next >