< prev index next >

src/hotspot/share/gc/shared/genArguments.cpp

Print this page




  73          "HeapAlignment: " SIZE_FORMAT " less than GenAlignment: " SIZE_FORMAT,
  74          HeapAlignment, GenAlignment);
  75   assert(GenAlignment % SpaceAlignment == 0,
  76          "GenAlignment: " SIZE_FORMAT " not aligned by SpaceAlignment: " SIZE_FORMAT,
  77          GenAlignment, SpaceAlignment);
  78   assert(HeapAlignment % GenAlignment == 0,
  79          "HeapAlignment: " SIZE_FORMAT " not aligned by GenAlignment: " SIZE_FORMAT,
  80          HeapAlignment, GenAlignment);
  81 
  82   // All generational heaps have a young gen; handle those flags here
  83 
  84   // Make sure the heap is large enough for two generations
  85   size_t smallest_new_size = young_gen_size_lower_bound();
  86   size_t smallest_heap_size = align_up(smallest_new_size + old_gen_size_lower_bound(),
  87                                        HeapAlignment);
  88   if (MaxHeapSize < smallest_heap_size) {
  89     FLAG_SET_ERGO(MaxHeapSize, smallest_heap_size);
  90   }
  91   // If needed, synchronize MinHeapSize size and InitialHeapSize
  92   if (MinHeapSize < smallest_heap_size) {
  93     FLAG_SET_ERGO(MinHeapSize, smallest_heap_size);
  94     if (InitialHeapSize < MinHeapSize) {
  95       FLAG_SET_ERGO(InitialHeapSize, smallest_heap_size);
  96     }
  97   }
  98 
  99   // Make sure NewSize allows an old generation to fit even if set on the command line
 100   if (FLAG_IS_CMDLINE(NewSize) && NewSize >= InitialHeapSize) {
 101     log_warning(gc, ergo)("NewSize was set larger than initial heap size, will use initial heap size.");
 102     FLAG_SET_ERGO(NewSize, bound_minus_alignment(NewSize, InitialHeapSize, GenAlignment));
 103   }
 104 
 105   // Now take the actual NewSize into account. We will silently increase NewSize
 106   // if the user specified a smaller or unaligned value.
 107   size_t bounded_new_size = bound_minus_alignment(NewSize, MaxHeapSize, GenAlignment);
 108   bounded_new_size = MAX2(smallest_new_size, align_down(bounded_new_size, GenAlignment));
 109   if (bounded_new_size != NewSize) {
 110     FLAG_SET_ERGO(NewSize, bounded_new_size);
 111   }
 112   MinNewSize = smallest_new_size;
 113 




  73          "HeapAlignment: " SIZE_FORMAT " less than GenAlignment: " SIZE_FORMAT,
  74          HeapAlignment, GenAlignment);
  75   assert(GenAlignment % SpaceAlignment == 0,
  76          "GenAlignment: " SIZE_FORMAT " not aligned by SpaceAlignment: " SIZE_FORMAT,
  77          GenAlignment, SpaceAlignment);
  78   assert(HeapAlignment % GenAlignment == 0,
  79          "HeapAlignment: " SIZE_FORMAT " not aligned by GenAlignment: " SIZE_FORMAT,
  80          HeapAlignment, GenAlignment);
  81 
  82   // All generational heaps have a young gen; handle those flags here
  83 
  84   // Make sure the heap is large enough for two generations
  85   size_t smallest_new_size = young_gen_size_lower_bound();
  86   size_t smallest_heap_size = align_up(smallest_new_size + old_gen_size_lower_bound(),
  87                                        HeapAlignment);
  88   if (MaxHeapSize < smallest_heap_size) {
  89     FLAG_SET_ERGO(MaxHeapSize, smallest_heap_size);
  90   }
  91   // If needed, synchronize MinHeapSize size and InitialHeapSize
  92   if (MinHeapSize < smallest_heap_size) {
  93     MinHeapSize = smallest_heap_size;
  94     if (InitialHeapSize < MinHeapSize) {
  95       FLAG_SET_ERGO(InitialHeapSize, smallest_heap_size);
  96     }
  97   }
  98 
  99   // Make sure NewSize allows an old generation to fit even if set on the command line
 100   if (FLAG_IS_CMDLINE(NewSize) && NewSize >= InitialHeapSize) {
 101     log_warning(gc, ergo)("NewSize was set larger than initial heap size, will use initial heap size.");
 102     FLAG_SET_ERGO(NewSize, bound_minus_alignment(NewSize, InitialHeapSize, GenAlignment));
 103   }
 104 
 105   // Now take the actual NewSize into account. We will silently increase NewSize
 106   // if the user specified a smaller or unaligned value.
 107   size_t bounded_new_size = bound_minus_alignment(NewSize, MaxHeapSize, GenAlignment);
 108   bounded_new_size = MAX2(smallest_new_size, align_down(bounded_new_size, GenAlignment));
 109   if (bounded_new_size != NewSize) {
 110     FLAG_SET_ERGO(NewSize, bounded_new_size);
 111   }
 112   MinNewSize = smallest_new_size;
 113 


< prev index next >