< prev index next >

src/hotspot/share/gc/g1/g1CollectedHeap.cpp

Print this page

  70 #include "gc/g1/g1Trace.hpp"
  71 #include "gc/g1/g1UncommitRegionTask.hpp"
  72 #include "gc/g1/g1VMOperations.hpp"
  73 #include "gc/g1/g1YoungCollector.hpp"
  74 #include "gc/g1/g1YoungGCEvacFailureInjector.hpp"
  75 #include "gc/g1/heapRegion.inline.hpp"
  76 #include "gc/g1/heapRegionRemSet.inline.hpp"
  77 #include "gc/g1/heapRegionSet.inline.hpp"
  78 #include "gc/shared/concurrentGCBreakpoints.hpp"
  79 #include "gc/shared/gcBehaviours.hpp"
  80 #include "gc/shared/gcHeapSummary.hpp"
  81 #include "gc/shared/gcId.hpp"
  82 #include "gc/shared/gcLocker.hpp"
  83 #include "gc/shared/gcTimer.hpp"
  84 #include "gc/shared/gcTraceTime.inline.hpp"
  85 #include "gc/shared/generationSpec.hpp"
  86 #include "gc/shared/isGCActiveMark.hpp"
  87 #include "gc/shared/locationPrinter.inline.hpp"
  88 #include "gc/shared/oopStorageParState.hpp"
  89 #include "gc/shared/preservedMarks.inline.hpp"


  90 #include "gc/shared/referenceProcessor.inline.hpp"
  91 #include "gc/shared/suspendibleThreadSet.hpp"
  92 #include "gc/shared/taskqueue.inline.hpp"
  93 #include "gc/shared/taskTerminator.hpp"
  94 #include "gc/shared/tlab_globals.hpp"
  95 #include "gc/shared/workerPolicy.hpp"
  96 #include "gc/shared/weakProcessor.inline.hpp"
  97 #include "logging/log.hpp"
  98 #include "memory/allocation.hpp"
  99 #include "memory/heapInspection.hpp"
 100 #include "memory/iterator.hpp"
 101 #include "memory/metaspaceUtils.hpp"
 102 #include "memory/resourceArea.hpp"
 103 #include "memory/universe.hpp"
 104 #include "oops/access.inline.hpp"
 105 #include "oops/compressedOops.inline.hpp"
 106 #include "oops/oop.inline.hpp"
 107 #include "runtime/atomic.hpp"
 108 #include "runtime/handles.inline.hpp"
 109 #include "runtime/init.hpp"

1568   Universe::check_alignment(reserved_byte_size, HeapAlignment, "g1 heap");
1569 
1570   // Reserve the maximum.
1571 
1572   // When compressed oops are enabled, the preferred heap base
1573   // is calculated by subtracting the requested size from the
1574   // 32Gb boundary and using the result as the base address for
1575   // heap reservation. If the requested size is not aligned to
1576   // HeapRegion::GrainBytes (i.e. the alignment that is passed
1577   // into the ReservedHeapSpace constructor) then the actual
1578   // base of the reserved heap may end up differing from the
1579   // address that was requested (i.e. the preferred heap base).
1580   // If this happens then we could end up using a non-optimal
1581   // compressed oops mode.
1582 
1583   ReservedHeapSpace heap_rs = Universe::reserve_heap(reserved_byte_size,
1584                                                      HeapAlignment);
1585 
1586   initialize_reserved_region(heap_rs);
1587 


1588   // Create the barrier set for the entire reserved region.
1589   G1CardTable* ct = new G1CardTable(heap_rs.region());
1590   ct->initialize();
1591   G1BarrierSet* bs = new G1BarrierSet(ct);
1592   bs->initialize();
1593   assert(bs->is_a(BarrierSet::G1BarrierSet), "sanity");
1594   BarrierSet::set_barrier_set(bs);
1595   _card_table = ct;
1596 
1597   {
1598     G1SATBMarkQueueSet& satbqs = bs->satb_mark_queue_set();
1599     satbqs.set_process_completed_buffers_threshold(G1SATBProcessCompletedThreshold);
1600     satbqs.set_buffer_enqueue_threshold_percentage(G1SATBBufferEnqueueingThresholdPercent);
1601   }
1602 
1603   // Create the hot card cache.
1604   _hot_card_cache = new G1HotCardCache(this);
1605 
1606   // Create space mappers.
1607   size_t page_size = heap_rs.page_size();

  70 #include "gc/g1/g1Trace.hpp"
  71 #include "gc/g1/g1UncommitRegionTask.hpp"
  72 #include "gc/g1/g1VMOperations.hpp"
  73 #include "gc/g1/g1YoungCollector.hpp"
  74 #include "gc/g1/g1YoungGCEvacFailureInjector.hpp"
  75 #include "gc/g1/heapRegion.inline.hpp"
  76 #include "gc/g1/heapRegionRemSet.inline.hpp"
  77 #include "gc/g1/heapRegionSet.inline.hpp"
  78 #include "gc/shared/concurrentGCBreakpoints.hpp"
  79 #include "gc/shared/gcBehaviours.hpp"
  80 #include "gc/shared/gcHeapSummary.hpp"
  81 #include "gc/shared/gcId.hpp"
  82 #include "gc/shared/gcLocker.hpp"
  83 #include "gc/shared/gcTimer.hpp"
  84 #include "gc/shared/gcTraceTime.inline.hpp"
  85 #include "gc/shared/generationSpec.hpp"
  86 #include "gc/shared/isGCActiveMark.hpp"
  87 #include "gc/shared/locationPrinter.inline.hpp"
  88 #include "gc/shared/oopStorageParState.hpp"
  89 #include "gc/shared/preservedMarks.inline.hpp"
  90 #include "gc/shared/slidingForwarding.inline.hpp"
  91 #include "gc/shared/suspendibleThreadSet.hpp"
  92 #include "gc/shared/referenceProcessor.inline.hpp"
  93 #include "gc/shared/suspendibleThreadSet.hpp"
  94 #include "gc/shared/taskqueue.inline.hpp"
  95 #include "gc/shared/taskTerminator.hpp"
  96 #include "gc/shared/tlab_globals.hpp"
  97 #include "gc/shared/workerPolicy.hpp"
  98 #include "gc/shared/weakProcessor.inline.hpp"
  99 #include "logging/log.hpp"
 100 #include "memory/allocation.hpp"
 101 #include "memory/heapInspection.hpp"
 102 #include "memory/iterator.hpp"
 103 #include "memory/metaspaceUtils.hpp"
 104 #include "memory/resourceArea.hpp"
 105 #include "memory/universe.hpp"
 106 #include "oops/access.inline.hpp"
 107 #include "oops/compressedOops.inline.hpp"
 108 #include "oops/oop.inline.hpp"
 109 #include "runtime/atomic.hpp"
 110 #include "runtime/handles.inline.hpp"
 111 #include "runtime/init.hpp"

1570   Universe::check_alignment(reserved_byte_size, HeapAlignment, "g1 heap");
1571 
1572   // Reserve the maximum.
1573 
1574   // When compressed oops are enabled, the preferred heap base
1575   // is calculated by subtracting the requested size from the
1576   // 32Gb boundary and using the result as the base address for
1577   // heap reservation. If the requested size is not aligned to
1578   // HeapRegion::GrainBytes (i.e. the alignment that is passed
1579   // into the ReservedHeapSpace constructor) then the actual
1580   // base of the reserved heap may end up differing from the
1581   // address that was requested (i.e. the preferred heap base).
1582   // If this happens then we could end up using a non-optimal
1583   // compressed oops mode.
1584 
1585   ReservedHeapSpace heap_rs = Universe::reserve_heap(reserved_byte_size,
1586                                                      HeapAlignment);
1587 
1588   initialize_reserved_region(heap_rs);
1589 
1590   _forwarding = new SlidingForwarding(heap_rs.region(), HeapRegion::LogOfHRGrainBytes - LogHeapWordSize);
1591 
1592   // Create the barrier set for the entire reserved region.
1593   G1CardTable* ct = new G1CardTable(heap_rs.region());
1594   ct->initialize();
1595   G1BarrierSet* bs = new G1BarrierSet(ct);
1596   bs->initialize();
1597   assert(bs->is_a(BarrierSet::G1BarrierSet), "sanity");
1598   BarrierSet::set_barrier_set(bs);
1599   _card_table = ct;
1600 
1601   {
1602     G1SATBMarkQueueSet& satbqs = bs->satb_mark_queue_set();
1603     satbqs.set_process_completed_buffers_threshold(G1SATBProcessCompletedThreshold);
1604     satbqs.set_buffer_enqueue_threshold_percentage(G1SATBBufferEnqueueingThresholdPercent);
1605   }
1606 
1607   // Create the hot card cache.
1608   _hot_card_cache = new G1HotCardCache(this);
1609 
1610   // Create space mappers.
1611   size_t page_size = heap_rs.page_size();
< prev index next >