< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahArguments.cpp

Print this page

191   }
192 
193   // Gen shen does not support any ShenandoahGCHeuristics value except for the default "adaptive"
194   if ((strcmp(ShenandoahGCMode, "generational") == 0)
195       && strcmp(ShenandoahGCHeuristics, "adaptive") != 0) {
196     log_warning(gc)("Ignoring -XX:ShenandoahGCHeuristics input: %s, because generational shenandoah only"
197       " supports adaptive heuristics", ShenandoahGCHeuristics);
198     FLAG_SET_ERGO(ShenandoahGCHeuristics, "adaptive");
199   }
200 
201   if (ShenandoahMomentaryAllocRateSampleWindow > ShenandoahRecentAllocRateSampleWindow
202     || ShenandoahRecentAllocRateSampleWindow > ShenandoahAllocRateSampleWindow) {
203     vm_exit_during_initialization(
204       err_msg("Relation must hold: ShenandoahMomentaryAllocRateSampleWindow (%u) "
205               "<= ShenandoahRecentAllocRateSampleWindow (%u) "
206               "<= ShenandoahAllocRateSampleWindow (%u)",
207         ShenandoahMomentaryAllocRateSampleWindow, ShenandoahRecentAllocRateSampleWindow,
208         ShenandoahAllocRateSampleWindow));
209   }
210 









211   FullGCForwarding::initialize_flags(MaxHeapSize);
212 }
213 
214 size_t ShenandoahArguments::conservative_max_heap_alignment() {
215   static_assert(is_power_of_2(ShenandoahHeapRegion::MAX_REGION_SIZE), "Max region size must be a power of 2.");
216   size_t align = ShenandoahHeapRegion::MAX_REGION_SIZE;
217   if (UseLargePages) {
218     align = MAX2(align, os::large_page_size());
219   }
220   return align;
221 }
222 
223 void ShenandoahArguments::initialize_alignments() {
224   CardTable::initialize_card_size();
225 
226   // Need to setup sizes early to get correct alignments.
227   MaxHeapSize = ShenandoahHeapRegion::setup_sizes(MaxHeapSize);
228 
229   // This is expected by our algorithm for ShenandoahHeap::heap_region_containing().
230   size_t align = ShenandoahHeapRegion::region_size_bytes();

191   }
192 
193   // Gen shen does not support any ShenandoahGCHeuristics value except for the default "adaptive"
194   if ((strcmp(ShenandoahGCMode, "generational") == 0)
195       && strcmp(ShenandoahGCHeuristics, "adaptive") != 0) {
196     log_warning(gc)("Ignoring -XX:ShenandoahGCHeuristics input: %s, because generational shenandoah only"
197       " supports adaptive heuristics", ShenandoahGCHeuristics);
198     FLAG_SET_ERGO(ShenandoahGCHeuristics, "adaptive");
199   }
200 
201   if (ShenandoahMomentaryAllocRateSampleWindow > ShenandoahRecentAllocRateSampleWindow
202     || ShenandoahRecentAllocRateSampleWindow > ShenandoahAllocRateSampleWindow) {
203     vm_exit_during_initialization(
204       err_msg("Relation must hold: ShenandoahMomentaryAllocRateSampleWindow (%u) "
205               "<= ShenandoahRecentAllocRateSampleWindow (%u) "
206               "<= ShenandoahAllocRateSampleWindow (%u)",
207         ShenandoahMomentaryAllocRateSampleWindow, ShenandoahRecentAllocRateSampleWindow,
208         ShenandoahAllocRateSampleWindow));
209   }
210 
211   if (Arguments::is_valhalla_enabled()) {
212     // Flat atomic payloads may contain embedded oops. Current Valhalla code does not handle
213     // it well, missing the GC barriers. As the temporary kludge, disable compressed oops:
214     // this would make flat atomic payloads contain at most one oop, which would be treated
215     // as the single oop field.
216     log_warning(gc)("Shenandoah disables compressed oops to avoid breaking with Valhalla");
217     FLAG_SET_ERGO(UseCompressedOops, false);
218   }
219 
220   FullGCForwarding::initialize_flags(MaxHeapSize);
221 }
222 
223 size_t ShenandoahArguments::conservative_max_heap_alignment() {
224   static_assert(is_power_of_2(ShenandoahHeapRegion::MAX_REGION_SIZE), "Max region size must be a power of 2.");
225   size_t align = ShenandoahHeapRegion::MAX_REGION_SIZE;
226   if (UseLargePages) {
227     align = MAX2(align, os::large_page_size());
228   }
229   return align;
230 }
231 
232 void ShenandoahArguments::initialize_alignments() {
233   CardTable::initialize_card_size();
234 
235   // Need to setup sizes early to get correct alignments.
236   MaxHeapSize = ShenandoahHeapRegion::setup_sizes(MaxHeapSize);
237 
238   // This is expected by our algorithm for ShenandoahHeap::heap_region_containing().
239   size_t align = ShenandoahHeapRegion::region_size_bytes();
< prev index next >