< prev index next >

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

Print this page




1525   // 32Gb boundary and using the result as the base address for
1526   // heap reservation. If the requested size is not aligned to
1527   // HeapRegion::GrainBytes (i.e. the alignment that is passed
1528   // into the ReservedHeapSpace constructor) then the actual
1529   // base of the reserved heap may end up differing from the
1530   // address that was requested (i.e. the preferred heap base).
1531   // If this happens then we could end up using a non-optimal
1532   // compressed oops mode.
1533 
1534   ReservedSpace heap_rs = Universe::reserve_heap(max_byte_size,
1535                                                  heap_alignment);
1536 
1537   initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size()));
1538 
1539   // Create the barrier set for the entire reserved region.
1540   G1CardTable* ct = new G1CardTable(reserved_region());
1541   ct->initialize();
1542   G1BarrierSet* bs = new G1BarrierSet(ct);
1543   bs->initialize();
1544   assert(bs->is_a(BarrierSet::G1BarrierSet), "sanity");
1545   set_barrier_set(bs);
1546   _card_table = ct;
1547 
1548   // Create the hot card cache.
1549   _hot_card_cache = new G1HotCardCache(this);
1550 
1551   // Carve out the G1 part of the heap.
1552   ReservedSpace g1_rs = heap_rs.first_part(max_byte_size);
1553   size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
1554   G1RegionToSpaceMapper* heap_storage =
1555     G1RegionToSpaceMapper::create_mapper(g1_rs,
1556                                          g1_rs.size(),
1557                                          page_size,
1558                                          HeapRegion::GrainBytes,
1559                                          1,
1560                                          mtJavaHeap);
1561   os::trace_page_sizes("Heap",
1562                        collector_policy()->min_heap_byte_size(),
1563                        max_byte_size,
1564                        page_size,
1565                        heap_rs.base(),




1525   // 32Gb boundary and using the result as the base address for
1526   // heap reservation. If the requested size is not aligned to
1527   // HeapRegion::GrainBytes (i.e. the alignment that is passed
1528   // into the ReservedHeapSpace constructor) then the actual
1529   // base of the reserved heap may end up differing from the
1530   // address that was requested (i.e. the preferred heap base).
1531   // If this happens then we could end up using a non-optimal
1532   // compressed oops mode.
1533 
1534   ReservedSpace heap_rs = Universe::reserve_heap(max_byte_size,
1535                                                  heap_alignment);
1536 
1537   initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size()));
1538 
1539   // Create the barrier set for the entire reserved region.
1540   G1CardTable* ct = new G1CardTable(reserved_region());
1541   ct->initialize();
1542   G1BarrierSet* bs = new G1BarrierSet(ct);
1543   bs->initialize();
1544   assert(bs->is_a(BarrierSet::G1BarrierSet), "sanity");
1545   BarrierSet::set_barrier_set(bs);
1546   _card_table = ct;
1547 
1548   // Create the hot card cache.
1549   _hot_card_cache = new G1HotCardCache(this);
1550 
1551   // Carve out the G1 part of the heap.
1552   ReservedSpace g1_rs = heap_rs.first_part(max_byte_size);
1553   size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
1554   G1RegionToSpaceMapper* heap_storage =
1555     G1RegionToSpaceMapper::create_mapper(g1_rs,
1556                                          g1_rs.size(),
1557                                          page_size,
1558                                          HeapRegion::GrainBytes,
1559                                          1,
1560                                          mtJavaHeap);
1561   os::trace_page_sizes("Heap",
1562                        collector_policy()->min_heap_byte_size(),
1563                        max_byte_size,
1564                        page_size,
1565                        heap_rs.base(),


< prev index next >