< prev index next >

src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp

Print this page




1837   // is calculated by subtracting the requested size from the
1838   // 32Gb boundary and using the result as the base address for
1839   // heap reservation. If the requested size is not aligned to
1840   // HeapRegion::GrainBytes (i.e. the alignment that is passed
1841   // into the ReservedHeapSpace constructor) then the actual
1842   // base of the reserved heap may end up differing from the
1843   // address that was requested (i.e. the preferred heap base).
1844   // If this happens then we could end up using a non-optimal
1845   // compressed oops mode.
1846 
1847   ReservedSpace heap_rs = Universe::reserve_heap(max_byte_size,
1848                                                  heap_alignment);
1849 
1850   initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size()));
1851 
1852   // Create the barrier set for the entire reserved region.
1853   G1SATBCardTableLoggingModRefBS* bs
1854     = new G1SATBCardTableLoggingModRefBS(reserved_region());
1855   bs->initialize();
1856   assert(bs->is_a(BarrierSet::G1SATBCTLogging), "sanity");
1857   _barrier_set = bs;
1858   oopDesc::set_bs(bs);
1859 
1860   // Also create a G1 rem set.
1861   _g1_rem_set = new G1RemSet(this, g1_barrier_set());
1862 
1863   // Carve out the G1 part of the heap.
1864 
1865   ReservedSpace g1_rs = heap_rs.first_part(max_byte_size);
1866   G1RegionToSpaceMapper* heap_storage =
1867     G1RegionToSpaceMapper::create_mapper(g1_rs,
1868                                          UseLargePages ? os::large_page_size() : os::vm_page_size(),
1869                                          HeapRegion::GrainBytes,
1870                                          1,
1871                                          mtJavaHeap);
1872   heap_storage->set_mapping_changed_listener(&_listener);
1873 
1874   // Reserve space for the block offset table. We do not support automatic uncommit
1875   // for the card table at this time. BOT only.
1876   ReservedSpace bot_rs(G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize));
1877   G1RegionToSpaceMapper* bot_storage =
1878     G1RegionToSpaceMapper::create_mapper(bot_rs,




1837   // is calculated by subtracting the requested size from the
1838   // 32Gb boundary and using the result as the base address for
1839   // heap reservation. If the requested size is not aligned to
1840   // HeapRegion::GrainBytes (i.e. the alignment that is passed
1841   // into the ReservedHeapSpace constructor) then the actual
1842   // base of the reserved heap may end up differing from the
1843   // address that was requested (i.e. the preferred heap base).
1844   // If this happens then we could end up using a non-optimal
1845   // compressed oops mode.
1846 
1847   ReservedSpace heap_rs = Universe::reserve_heap(max_byte_size,
1848                                                  heap_alignment);
1849 
1850   initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size()));
1851 
1852   // Create the barrier set for the entire reserved region.
1853   G1SATBCardTableLoggingModRefBS* bs
1854     = new G1SATBCardTableLoggingModRefBS(reserved_region());
1855   bs->initialize();
1856   assert(bs->is_a(BarrierSet::G1SATBCTLogging), "sanity");
1857   set_barrier_set(bs);

1858 
1859   // Also create a G1 rem set.
1860   _g1_rem_set = new G1RemSet(this, g1_barrier_set());
1861 
1862   // Carve out the G1 part of the heap.
1863 
1864   ReservedSpace g1_rs = heap_rs.first_part(max_byte_size);
1865   G1RegionToSpaceMapper* heap_storage =
1866     G1RegionToSpaceMapper::create_mapper(g1_rs,
1867                                          UseLargePages ? os::large_page_size() : os::vm_page_size(),
1868                                          HeapRegion::GrainBytes,
1869                                          1,
1870                                          mtJavaHeap);
1871   heap_storage->set_mapping_changed_listener(&_listener);
1872 
1873   // Reserve space for the block offset table. We do not support automatic uncommit
1874   // for the card table at this time. BOT only.
1875   ReservedSpace bot_rs(G1BlockOffsetSharedArray::compute_size(g1_rs.size() / HeapWordSize));
1876   G1RegionToSpaceMapper* bot_storage =
1877     G1RegionToSpaceMapper::create_mapper(bot_rs,


< prev index next >