< prev index next >

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

Print this page

  65 #include "gc/g1/g1Trace.hpp"
  66 #include "gc/g1/g1ServiceThread.hpp"
  67 #include "gc/g1/g1UncommitRegionTask.hpp"
  68 #include "gc/g1/g1VMOperations.hpp"
  69 #include "gc/g1/g1YoungGCPostEvacuateTasks.hpp"
  70 #include "gc/g1/heapRegion.inline.hpp"
  71 #include "gc/g1/heapRegionRemSet.hpp"
  72 #include "gc/g1/heapRegionSet.inline.hpp"
  73 #include "gc/shared/concurrentGCBreakpoints.hpp"
  74 #include "gc/shared/gcBehaviours.hpp"
  75 #include "gc/shared/gcHeapSummary.hpp"
  76 #include "gc/shared/gcId.hpp"
  77 #include "gc/shared/gcLocker.hpp"
  78 #include "gc/shared/gcTimer.hpp"
  79 #include "gc/shared/gcTraceTime.inline.hpp"
  80 #include "gc/shared/generationSpec.hpp"
  81 #include "gc/shared/isGCActiveMark.hpp"
  82 #include "gc/shared/locationPrinter.inline.hpp"
  83 #include "gc/shared/oopStorageParState.hpp"
  84 #include "gc/shared/preservedMarks.inline.hpp"

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

1586   Universe::check_alignment(reserved_byte_size, HeapAlignment, "g1 heap");
1587 
1588   // Reserve the maximum.
1589 
1590   // When compressed oops are enabled, the preferred heap base
1591   // is calculated by subtracting the requested size from the
1592   // 32Gb boundary and using the result as the base address for
1593   // heap reservation. If the requested size is not aligned to
1594   // HeapRegion::GrainBytes (i.e. the alignment that is passed
1595   // into the ReservedHeapSpace constructor) then the actual
1596   // base of the reserved heap may end up differing from the
1597   // address that was requested (i.e. the preferred heap base).
1598   // If this happens then we could end up using a non-optimal
1599   // compressed oops mode.
1600 
1601   ReservedHeapSpace heap_rs = Universe::reserve_heap(reserved_byte_size,
1602                                                      HeapAlignment);
1603 
1604   initialize_reserved_region(heap_rs);
1605 


1606   // Create the barrier set for the entire reserved region.
1607   G1CardTable* ct = new G1CardTable(heap_rs.region());
1608   ct->initialize();
1609   G1BarrierSet* bs = new G1BarrierSet(ct);
1610   bs->initialize();
1611   assert(bs->is_a(BarrierSet::G1BarrierSet), "sanity");
1612   BarrierSet::set_barrier_set(bs);
1613   _card_table = ct;
1614 
1615   {
1616     G1SATBMarkQueueSet& satbqs = bs->satb_mark_queue_set();
1617     satbqs.set_process_completed_buffers_threshold(G1SATBProcessCompletedThreshold);
1618     satbqs.set_buffer_enqueue_threshold_percentage(G1SATBBufferEnqueueingThresholdPercent);
1619   }
1620 
1621   // Create the hot card cache.
1622   _hot_card_cache = new G1HotCardCache(this);
1623 
1624   // Create space mappers.
1625   size_t page_size = heap_rs.page_size();

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

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