< prev index next >

src/share/vm/gc/shared/collectorPolicy.cpp

Print this page




  79   assert(_space_alignment != 0, "Space alignment not set up properly");
  80   assert(_heap_alignment != 0, "Heap alignment not set up properly");
  81   assert(_heap_alignment >= _space_alignment,
  82          "heap_alignment: " SIZE_FORMAT " less than space_alignment: " SIZE_FORMAT,
  83          _heap_alignment, _space_alignment);
  84   assert(_heap_alignment % _space_alignment == 0,
  85          "heap_alignment: " SIZE_FORMAT " not aligned by space_alignment: " SIZE_FORMAT,
  86          _heap_alignment, _space_alignment);
  87 
  88   if (FLAG_IS_CMDLINE(MaxHeapSize)) {
  89     if (FLAG_IS_CMDLINE(InitialHeapSize) && InitialHeapSize > MaxHeapSize) {
  90       vm_exit_during_initialization("Initial heap size set to a larger value than the maximum heap size");
  91     }
  92     if (_min_heap_byte_size != 0 && MaxHeapSize < _min_heap_byte_size) {
  93       vm_exit_during_initialization("Incompatible minimum and maximum heap sizes specified");
  94     }
  95     _max_heap_size_cmdline = true;
  96   }
  97 
  98   // Check heap parameter properties



  99   if (InitialHeapSize < M) {
 100     vm_exit_during_initialization("Too small initial heap");
 101   }
 102   if (_min_heap_byte_size < M) {
 103     vm_exit_during_initialization("Too small minimum heap");
 104   }
 105 
 106   // User inputs from -Xmx and -Xms must be aligned
 107   _min_heap_byte_size = align_size_up(_min_heap_byte_size, _heap_alignment);
 108   size_t aligned_initial_heap_size = align_size_up(InitialHeapSize, _heap_alignment);
 109   size_t aligned_max_heap_size = align_size_up(MaxHeapSize, _heap_alignment);
 110 
 111   // Write back to flags if the values changed
 112   if (aligned_initial_heap_size != InitialHeapSize) {
 113     FLAG_SET_ERGO(size_t, InitialHeapSize, aligned_initial_heap_size);
 114   }
 115   if (aligned_max_heap_size != MaxHeapSize) {
 116     FLAG_SET_ERGO(size_t, MaxHeapSize, aligned_max_heap_size);
 117   }
 118 




  79   assert(_space_alignment != 0, "Space alignment not set up properly");
  80   assert(_heap_alignment != 0, "Heap alignment not set up properly");
  81   assert(_heap_alignment >= _space_alignment,
  82          "heap_alignment: " SIZE_FORMAT " less than space_alignment: " SIZE_FORMAT,
  83          _heap_alignment, _space_alignment);
  84   assert(_heap_alignment % _space_alignment == 0,
  85          "heap_alignment: " SIZE_FORMAT " not aligned by space_alignment: " SIZE_FORMAT,
  86          _heap_alignment, _space_alignment);
  87 
  88   if (FLAG_IS_CMDLINE(MaxHeapSize)) {
  89     if (FLAG_IS_CMDLINE(InitialHeapSize) && InitialHeapSize > MaxHeapSize) {
  90       vm_exit_during_initialization("Initial heap size set to a larger value than the maximum heap size");
  91     }
  92     if (_min_heap_byte_size != 0 && MaxHeapSize < _min_heap_byte_size) {
  93       vm_exit_during_initialization("Incompatible minimum and maximum heap sizes specified");
  94     }
  95     _max_heap_size_cmdline = true;
  96   }
  97 
  98   // Check heap parameter properties
  99   if (MaxHeapSize < 2 * M) {
 100     vm_exit_during_initialization("Too small maximum heap");
 101   }
 102   if (InitialHeapSize < M) {
 103     vm_exit_during_initialization("Too small initial heap");
 104   }
 105   if (_min_heap_byte_size < M) {
 106     vm_exit_during_initialization("Too small minimum heap");
 107   }
 108 
 109   // User inputs from -Xmx and -Xms must be aligned
 110   _min_heap_byte_size = align_size_up(_min_heap_byte_size, _heap_alignment);
 111   size_t aligned_initial_heap_size = align_size_up(InitialHeapSize, _heap_alignment);
 112   size_t aligned_max_heap_size = align_size_up(MaxHeapSize, _heap_alignment);
 113 
 114   // Write back to flags if the values changed
 115   if (aligned_initial_heap_size != InitialHeapSize) {
 116     FLAG_SET_ERGO(size_t, InitialHeapSize, aligned_initial_heap_size);
 117   }
 118   if (aligned_max_heap_size != MaxHeapSize) {
 119     FLAG_SET_ERGO(size_t, MaxHeapSize, aligned_max_heap_size);
 120   }
 121 


< prev index next >