< prev index next >

src/hotspot/share/gc/serial/serialHeap.cpp

Print this page

  38 #include "gc/serial/serialVMOperations.hpp"
  39 #include "gc/serial/tenuredGeneration.inline.hpp"
  40 #include "gc/shared/cardTableBarrierSet.hpp"
  41 #include "gc/shared/classUnloadingContext.hpp"
  42 #include "gc/shared/collectedHeap.inline.hpp"
  43 #include "gc/shared/collectorCounters.hpp"
  44 #include "gc/shared/continuationGCSupport.inline.hpp"
  45 #include "gc/shared/gcId.hpp"
  46 #include "gc/shared/gcInitLogger.hpp"
  47 #include "gc/shared/gcLocker.inline.hpp"
  48 #include "gc/shared/gcPolicyCounters.hpp"
  49 #include "gc/shared/gcTrace.hpp"
  50 #include "gc/shared/gcTraceTime.inline.hpp"
  51 #include "gc/shared/gcVMOperations.hpp"
  52 #include "gc/shared/genArguments.hpp"
  53 #include "gc/shared/locationPrinter.inline.hpp"
  54 #include "gc/shared/oopStorage.inline.hpp"
  55 #include "gc/shared/oopStorageParState.inline.hpp"
  56 #include "gc/shared/oopStorageSet.inline.hpp"
  57 #include "gc/shared/scavengableNMethods.hpp"

  58 #include "gc/shared/space.hpp"
  59 #include "gc/shared/strongRootsScope.hpp"
  60 #include "gc/shared/suspendibleThreadSet.hpp"
  61 #include "gc/shared/weakProcessor.hpp"
  62 #include "gc/shared/workerThread.hpp"
  63 #include "memory/iterator.hpp"
  64 #include "memory/metaspaceCounters.hpp"
  65 #include "memory/metaspaceUtils.hpp"
  66 #include "memory/resourceArea.hpp"
  67 #include "memory/universe.hpp"
  68 #include "oops/oop.inline.hpp"
  69 #include "runtime/handles.hpp"
  70 #include "runtime/handles.inline.hpp"
  71 #include "runtime/java.hpp"
  72 #include "runtime/mutexLocker.hpp"
  73 #include "runtime/threads.hpp"
  74 #include "runtime/vmThread.hpp"
  75 #include "services/memoryManager.hpp"
  76 #include "services/memoryService.hpp"
  77 #include "utilities/autoRestore.hpp"

 186     return JNI_ENOMEM;
 187   }
 188 
 189   initialize_reserved_region(heap_rs);
 190 
 191   ReservedSpace young_rs = heap_rs.first_part(MaxNewSize);
 192   ReservedSpace old_rs = heap_rs.last_part(MaxNewSize);
 193 
 194   _rem_set = new CardTableRS(heap_rs.region());
 195   _rem_set->initialize(young_rs.base(), old_rs.base());
 196 
 197   CardTableBarrierSet *bs = new CardTableBarrierSet(_rem_set);
 198   bs->initialize();
 199   BarrierSet::set_barrier_set(bs);
 200 
 201   _young_gen = new DefNewGeneration(young_rs, NewSize, MinNewSize, MaxNewSize);
 202   _old_gen = new TenuredGeneration(old_rs, OldSize, MinOldSize, MaxOldSize, rem_set());
 203 
 204   GCInitLogger::print();
 205 


 206   return JNI_OK;
 207 }
 208 
 209 ReservedHeapSpace SerialHeap::allocate(size_t alignment) {
 210   // Now figure out the total size.
 211   const size_t pageSize = UseLargePages ? os::large_page_size() : os::vm_page_size();
 212   assert(alignment % pageSize == 0, "Must be");
 213 
 214   // Check for overflow.
 215   size_t total_reserved = MaxNewSize + MaxOldSize;
 216   if (total_reserved < MaxNewSize) {
 217     vm_exit_during_initialization("The size of the object heap + VM data exceeds "
 218                                   "the maximum representable size");
 219   }
 220   assert(total_reserved % alignment == 0,
 221          "Gen size; total_reserved=" SIZE_FORMAT ", alignment="
 222          SIZE_FORMAT, total_reserved, alignment);
 223 
 224   ReservedHeapSpace heap_rs = Universe::reserve_heap(total_reserved, alignment);
 225   size_t used_page_size = heap_rs.page_size();

  38 #include "gc/serial/serialVMOperations.hpp"
  39 #include "gc/serial/tenuredGeneration.inline.hpp"
  40 #include "gc/shared/cardTableBarrierSet.hpp"
  41 #include "gc/shared/classUnloadingContext.hpp"
  42 #include "gc/shared/collectedHeap.inline.hpp"
  43 #include "gc/shared/collectorCounters.hpp"
  44 #include "gc/shared/continuationGCSupport.inline.hpp"
  45 #include "gc/shared/gcId.hpp"
  46 #include "gc/shared/gcInitLogger.hpp"
  47 #include "gc/shared/gcLocker.inline.hpp"
  48 #include "gc/shared/gcPolicyCounters.hpp"
  49 #include "gc/shared/gcTrace.hpp"
  50 #include "gc/shared/gcTraceTime.inline.hpp"
  51 #include "gc/shared/gcVMOperations.hpp"
  52 #include "gc/shared/genArguments.hpp"
  53 #include "gc/shared/locationPrinter.inline.hpp"
  54 #include "gc/shared/oopStorage.inline.hpp"
  55 #include "gc/shared/oopStorageParState.inline.hpp"
  56 #include "gc/shared/oopStorageSet.inline.hpp"
  57 #include "gc/shared/scavengableNMethods.hpp"
  58 #include "gc/shared/slidingForwarding.hpp"
  59 #include "gc/shared/space.hpp"
  60 #include "gc/shared/strongRootsScope.hpp"
  61 #include "gc/shared/suspendibleThreadSet.hpp"
  62 #include "gc/shared/weakProcessor.hpp"
  63 #include "gc/shared/workerThread.hpp"
  64 #include "memory/iterator.hpp"
  65 #include "memory/metaspaceCounters.hpp"
  66 #include "memory/metaspaceUtils.hpp"
  67 #include "memory/resourceArea.hpp"
  68 #include "memory/universe.hpp"
  69 #include "oops/oop.inline.hpp"
  70 #include "runtime/handles.hpp"
  71 #include "runtime/handles.inline.hpp"
  72 #include "runtime/java.hpp"
  73 #include "runtime/mutexLocker.hpp"
  74 #include "runtime/threads.hpp"
  75 #include "runtime/vmThread.hpp"
  76 #include "services/memoryManager.hpp"
  77 #include "services/memoryService.hpp"
  78 #include "utilities/autoRestore.hpp"

 187     return JNI_ENOMEM;
 188   }
 189 
 190   initialize_reserved_region(heap_rs);
 191 
 192   ReservedSpace young_rs = heap_rs.first_part(MaxNewSize);
 193   ReservedSpace old_rs = heap_rs.last_part(MaxNewSize);
 194 
 195   _rem_set = new CardTableRS(heap_rs.region());
 196   _rem_set->initialize(young_rs.base(), old_rs.base());
 197 
 198   CardTableBarrierSet *bs = new CardTableBarrierSet(_rem_set);
 199   bs->initialize();
 200   BarrierSet::set_barrier_set(bs);
 201 
 202   _young_gen = new DefNewGeneration(young_rs, NewSize, MinNewSize, MaxNewSize);
 203   _old_gen = new TenuredGeneration(old_rs, OldSize, MinOldSize, MaxOldSize, rem_set());
 204 
 205   GCInitLogger::print();
 206 
 207   SlidingForwarding::initialize(_reserved, SpaceAlignment / HeapWordSize);
 208 
 209   return JNI_OK;
 210 }
 211 
 212 ReservedHeapSpace SerialHeap::allocate(size_t alignment) {
 213   // Now figure out the total size.
 214   const size_t pageSize = UseLargePages ? os::large_page_size() : os::vm_page_size();
 215   assert(alignment % pageSize == 0, "Must be");
 216 
 217   // Check for overflow.
 218   size_t total_reserved = MaxNewSize + MaxOldSize;
 219   if (total_reserved < MaxNewSize) {
 220     vm_exit_during_initialization("The size of the object heap + VM data exceeds "
 221                                   "the maximum representable size");
 222   }
 223   assert(total_reserved % alignment == 0,
 224          "Gen size; total_reserved=" SIZE_FORMAT ", alignment="
 225          SIZE_FORMAT, total_reserved, alignment);
 226 
 227   ReservedHeapSpace heap_rs = Universe::reserve_heap(total_reserved, alignment);
 228   size_t used_page_size = heap_rs.page_size();
< prev index next >