1788 _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC);
1789 _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC);
1790
1791 for (int i = 0; i < n_queues; i++) {
1792 RefToScanQueue* q = new RefToScanQueue();
1793 q->initialize();
1794 _task_queues->register_queue(i, q);
1795 ::new (&_evacuation_failed_info_array[i]) EvacuationFailedInfo();
1796 }
1797 clear_cset_start_regions();
1798
1799 // Initialize the G1EvacuationFailureALot counters and flags.
1800 NOT_PRODUCT(reset_evacuation_should_fail();)
1801
1802 guarantee(_task_queues != NULL, "task_queues allocation failure.");
1803 }
1804
1805 G1RegionToSpaceMapper* G1CollectedHeap::create_aux_memory_mapper(const char* description,
1806 size_t size,
1807 size_t translation_factor) {
1808 // Allocate a new reserved space, preferring to use large pages.
1809 ReservedSpace rs(size, true);
1810 G1RegionToSpaceMapper* result =
1811 G1RegionToSpaceMapper::create_mapper(rs,
1812 size,
1813 rs.alignment(),
1814 HeapRegion::GrainBytes,
1815 translation_factor,
1816 mtGC);
1817 if (TracePageSizes) {
1818 gclog_or_tty->print_cr("G1 '%s': pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT " size=" SIZE_FORMAT " alignment=" SIZE_FORMAT " reqsize=" SIZE_FORMAT,
1819 description, rs.alignment(), p2i(rs.base()), rs.size(), rs.alignment(), size);
1820 }
1821 return result;
1822 }
1823
1824 jint G1CollectedHeap::initialize() {
1825 CollectedHeap::pre_initialize();
1826 os::enable_vtime();
1827
1828 G1Log::init();
1829
1830 // Necessary to satisfy locking discipline assertions.
1831
1832 MutexLocker x(Heap_lock);
1833
1834 // We have to initialize the printer before committing the heap, as
1835 // it will be used then.
1836 _hr_printer.set_active(G1PrintHeapRegions);
1837
1838 // While there are no constraints in the GC code that HeapWordSize
1839 // be any particular value, there are multiple other areas in the
|
1788 _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC);
1789 _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC);
1790
1791 for (int i = 0; i < n_queues; i++) {
1792 RefToScanQueue* q = new RefToScanQueue();
1793 q->initialize();
1794 _task_queues->register_queue(i, q);
1795 ::new (&_evacuation_failed_info_array[i]) EvacuationFailedInfo();
1796 }
1797 clear_cset_start_regions();
1798
1799 // Initialize the G1EvacuationFailureALot counters and flags.
1800 NOT_PRODUCT(reset_evacuation_should_fail();)
1801
1802 guarantee(_task_queues != NULL, "task_queues allocation failure.");
1803 }
1804
1805 G1RegionToSpaceMapper* G1CollectedHeap::create_aux_memory_mapper(const char* description,
1806 size_t size,
1807 size_t translation_factor) {
1808 size_t preferred_page_size = os::page_size_for_region_unaligned(size, 1);
1809 // Allocate a new reserved space, preferring to use large pages.
1810 ReservedSpace rs(size, preferred_page_size);
1811 G1RegionToSpaceMapper* result =
1812 G1RegionToSpaceMapper::create_mapper(rs,
1813 size,
1814 rs.alignment(),
1815 HeapRegion::GrainBytes,
1816 translation_factor,
1817 mtGC);
1818 if (TracePageSizes) {
1819 gclog_or_tty->print_cr("G1 '%s': pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT " size=" SIZE_FORMAT " alignment=" SIZE_FORMAT " reqsize=" SIZE_FORMAT,
1820 description, preferred_page_size, p2i(rs.base()), rs.size(), rs.alignment(), size);
1821 }
1822 return result;
1823 }
1824
1825 jint G1CollectedHeap::initialize() {
1826 CollectedHeap::pre_initialize();
1827 os::enable_vtime();
1828
1829 G1Log::init();
1830
1831 // Necessary to satisfy locking discipline assertions.
1832
1833 MutexLocker x(Heap_lock);
1834
1835 // We have to initialize the printer before committing the heap, as
1836 // it will be used then.
1837 _hr_printer.set_active(G1PrintHeapRegions);
1838
1839 // While there are no constraints in the GC code that HeapWordSize
1840 // be any particular value, there are multiple other areas in the
|