< prev index next >

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

Print this page

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

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

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


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

 37 #include "gc/serial/tenuredGeneration.inline.hpp"
 38 #include "gc/shared/cardTableBarrierSet.hpp"
 39 #include "gc/shared/classUnloadingContext.hpp"
 40 #include "gc/shared/collectedHeap.inline.hpp"
 41 #include "gc/shared/collectorCounters.hpp"
 42 #include "gc/shared/continuationGCSupport.inline.hpp"
 43 #include "gc/shared/gcId.hpp"
 44 #include "gc/shared/gcInitLogger.hpp"
 45 #include "gc/shared/gcLocker.inline.hpp"
 46 #include "gc/shared/gcPolicyCounters.hpp"
 47 #include "gc/shared/gcTrace.hpp"
 48 #include "gc/shared/gcTraceTime.inline.hpp"
 49 #include "gc/shared/gcVMOperations.hpp"
 50 #include "gc/shared/genArguments.hpp"
 51 #include "gc/shared/isGCActiveMark.hpp"
 52 #include "gc/shared/locationPrinter.inline.hpp"
 53 #include "gc/shared/oopStorage.inline.hpp"
 54 #include "gc/shared/oopStorageParState.inline.hpp"
 55 #include "gc/shared/oopStorageSet.inline.hpp"
 56 #include "gc/shared/scavengableNMethods.hpp"
 57 #include "gc/shared/slidingForwarding.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/debug.hpp"

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