< prev index next >

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

Print this page
rev 7992 : imported patch 8058354-more-more-stefank-review


1818   _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC);
1819   _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC);
1820 
1821   for (int i = 0; i < n_queues; i++) {
1822     RefToScanQueue* q = new RefToScanQueue();
1823     q->initialize();
1824     _task_queues->register_queue(i, q);
1825     ::new (&_evacuation_failed_info_array[i]) EvacuationFailedInfo();
1826   }
1827   clear_cset_start_regions();
1828 
1829   // Initialize the G1EvacuationFailureALot counters and flags.
1830   NOT_PRODUCT(reset_evacuation_should_fail();)
1831 
1832   guarantee(_task_queues != NULL, "task_queues allocation failure.");
1833 }
1834 
1835 G1RegionToSpaceMapper* G1CollectedHeap::create_aux_memory_mapper(const char* description,
1836                                                                  size_t size,
1837                                                                  size_t translation_factor) {
1838   // Determine the preferred page size for the auxiliary data structures. We always
1839   // prefer large pages if the given size allows it for performance reasons.
1840   size_t const commit_size = os::page_size_for_region_unaligned(size, 1);
1841   // The base address reserved space must be aligned to that page. Otherwise we
1842   // would need to split pages (or it would be completely impossible) when
1843   // uncommitting memory within the heap.
1844   // Size need *not* be aligned to above calculated commit size.
1845   size_t const alignment = MAX2(commit_size, (size_t)os::vm_allocation_granularity());
1846   bool const use_large_pages = commit_size != (size_t)os::vm_page_size() ? UseLargePages : false;
1847   ReservedSpace rs(align_size_up(size, alignment), alignment, use_large_pages);
1848   G1RegionToSpaceMapper* result  =
1849     G1RegionToSpaceMapper::create_mapper(rs,
1850                                          size,
1851                                          commit_size,
1852                                          HeapRegion::GrainBytes,
1853                                          translation_factor,
1854                                          mtGC);
1855   if (TracePageSizes) {
1856     gclog_or_tty->print_cr("G1 '%s': pg_sz=" SIZE_FORMAT" base=" PTR_FORMAT" size=" SIZE_FORMAT" alignment=" SIZE_FORMAT" reqsize=" SIZE_FORMAT,
1857                            description, commit_size, p2i(rs.base()), rs.size(), rs.alignment(), size);
1858   }
1859   return result;
1860 }
1861 
1862 jint G1CollectedHeap::initialize() {
1863   CollectedHeap::pre_initialize();
1864   os::enable_vtime();
1865 
1866   G1Log::init();
1867 
1868   // Necessary to satisfy locking discipline assertions.
1869 
1870   MutexLocker x(Heap_lock);
1871 
1872   // We have to initialize the printer before committing the heap, as
1873   // it will be used then.
1874   _hr_printer.set_active(G1PrintHeapRegions);
1875 
1876   // While there are no constraints in the GC code that HeapWordSize
1877   // be any particular value, there are multiple other areas in the




1818   _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC);
1819   _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC);
1820 
1821   for (int i = 0; i < n_queues; i++) {
1822     RefToScanQueue* q = new RefToScanQueue();
1823     q->initialize();
1824     _task_queues->register_queue(i, q);
1825     ::new (&_evacuation_failed_info_array[i]) EvacuationFailedInfo();
1826   }
1827   clear_cset_start_regions();
1828 
1829   // Initialize the G1EvacuationFailureALot counters and flags.
1830   NOT_PRODUCT(reset_evacuation_should_fail();)
1831 
1832   guarantee(_task_queues != NULL, "task_queues allocation failure.");
1833 }
1834 
1835 G1RegionToSpaceMapper* G1CollectedHeap::create_aux_memory_mapper(const char* description,
1836                                                                  size_t size,
1837                                                                  size_t translation_factor) {
1838   // Allocate a new reserved space, preferring to use large pages.
1839   ReservedSpace rs(size, true);








1840   G1RegionToSpaceMapper* result  =
1841     G1RegionToSpaceMapper::create_mapper(rs,
1842                                          size,
1843                                          rs.alignment(),
1844                                          HeapRegion::GrainBytes,
1845                                          translation_factor,
1846                                          mtGC);
1847   if (TracePageSizes) {
1848     gclog_or_tty->print_cr("G1 '%s': pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT " size=" SIZE_FORMAT " alignment=" SIZE_FORMAT " reqsize=" SIZE_FORMAT,
1849                            description, rs.alignment(), p2i(rs.base()), rs.size(), rs.alignment(), size);
1850   }
1851   return result;
1852 }
1853 
1854 jint G1CollectedHeap::initialize() {
1855   CollectedHeap::pre_initialize();
1856   os::enable_vtime();
1857 
1858   G1Log::init();
1859 
1860   // Necessary to satisfy locking discipline assertions.
1861 
1862   MutexLocker x(Heap_lock);
1863 
1864   // We have to initialize the printer before committing the heap, as
1865   // it will be used then.
1866   _hr_printer.set_active(G1PrintHeapRegions);
1867 
1868   // While there are no constraints in the GC code that HeapWordSize
1869   // be any particular value, there are multiple other areas in the


< prev index next >