< prev index next >

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

Print this page
rev 48000 : [mq]: open.patch
rev 48001 : [mq]: 8191564-diff.patch


1810 
1811   // Here we allocate the dummy HeapRegion that is required by the
1812   // G1AllocRegion class.
1813   HeapRegion* dummy_region = _hrm.get_dummy_region();
1814 
1815   // We'll re-use the same region whether the alloc region will
1816   // require BOT updates or not and, if it doesn't, then a non-young
1817   // region will complain that it cannot support allocations without
1818   // BOT updates. So we'll tag the dummy region as eden to avoid that.
1819   dummy_region->set_eden();
1820   // Make sure it's full.
1821   dummy_region->set_top(dummy_region->end());
1822   G1AllocRegion::setup(this, dummy_region);
1823 
1824   _allocator->init_mutator_alloc_region();
1825 
1826   // Do create of the monitoring and management support so that
1827   // values in the heap have been properly initialized.
1828   _g1mm = new G1MonitoringSupport(this);
1829 










1830   _eden_pool = new G1EdenPool(this);
1831   _survivor_pool = new G1SurvivorPool(this);
1832   _old_pool = new G1OldGenPool(this);
1833 
1834   _full_gc_memory_manager.add_pool(_eden_pool);
1835   _full_gc_memory_manager.add_pool(_survivor_pool);
1836   _full_gc_memory_manager.add_pool(_old_pool);
1837 
1838   _memory_manager.add_pool(_eden_pool);
1839   _memory_manager.add_pool(_survivor_pool);
1840 
1841   G1StringDedup::initialize();
1842 
1843   _preserved_marks_set.init(ParallelGCThreads);
1844 
1845   _collection_set.initialize(max_regions());
1846 
1847   return JNI_OK;
1848 }
1849 
1850 void G1CollectedHeap::stop() {
1851   // Stop all concurrent threads. We do this to make sure these threads
1852   // do not continue to execute and access resources (e.g. logging)
1853   // that are destroyed during shutdown.
1854   _cr->stop();
1855   _young_gen_sampling_thread->stop();
1856   _cmThread->stop();
1857   if (G1StringDedup::is_enabled()) {
1858     G1StringDedup::stop();
1859   }
1860 }
1861 
1862 void G1CollectedHeap::safepoint_synchronize_begin() {
1863   SuspendibleThreadSet::synchronize();
1864 }
1865 
1866 void G1CollectedHeap::safepoint_synchronize_end() {
1867   SuspendibleThreadSet::desynchronize();
1868 }
1869 
1870 size_t G1CollectedHeap::conservative_max_heap_alignment() {
1871   return HeapRegion::max_region_size();
1872 }
1873 
1874 void G1CollectedHeap::post_initialize() {

1875   ref_processing_init();
1876 }
1877 
1878 void G1CollectedHeap::ref_processing_init() {
1879   // Reference processing in G1 currently works as follows:
1880   //
1881   // * There are two reference processor instances. One is
1882   //   used to record and process discovered references
1883   //   during concurrent marking; the other is used to
1884   //   record and process references during STW pauses
1885   //   (both full and incremental).
1886   // * Both ref processors need to 'span' the entire heap as
1887   //   the regions in the collection set may be dotted around.
1888   //
1889   // * For the concurrent marking ref processor:
1890   //   * Reference discovery is enabled at initial marking.
1891   //   * Reference discovery is disabled and the discovered
1892   //     references processed etc during remarking.
1893   //   * Reference discovery is MT (see below).
1894   //   * Reference discovery requires a barrier (see below).




1810 
1811   // Here we allocate the dummy HeapRegion that is required by the
1812   // G1AllocRegion class.
1813   HeapRegion* dummy_region = _hrm.get_dummy_region();
1814 
1815   // We'll re-use the same region whether the alloc region will
1816   // require BOT updates or not and, if it doesn't, then a non-young
1817   // region will complain that it cannot support allocations without
1818   // BOT updates. So we'll tag the dummy region as eden to avoid that.
1819   dummy_region->set_eden();
1820   // Make sure it's full.
1821   dummy_region->set_top(dummy_region->end());
1822   G1AllocRegion::setup(this, dummy_region);
1823 
1824   _allocator->init_mutator_alloc_region();
1825 
1826   // Do create of the monitoring and management support so that
1827   // values in the heap have been properly initialized.
1828   _g1mm = new G1MonitoringSupport(this);
1829 
1830   G1StringDedup::initialize();
1831 
1832   _preserved_marks_set.init(ParallelGCThreads);
1833 
1834   _collection_set.initialize(max_regions());
1835 
1836   return JNI_OK;
1837 }
1838 
1839 void G1CollectedHeap::initialize_serviceability() {
1840   _eden_pool = new G1EdenPool(this);
1841   _survivor_pool = new G1SurvivorPool(this);
1842   _old_pool = new G1OldGenPool(this);
1843 
1844   _full_gc_memory_manager.add_pool(_eden_pool);
1845   _full_gc_memory_manager.add_pool(_survivor_pool);
1846   _full_gc_memory_manager.add_pool(_old_pool);
1847 
1848   _memory_manager.add_pool(_eden_pool);
1849   _memory_manager.add_pool(_survivor_pool);
1850 







1851 }
1852 
1853 void G1CollectedHeap::stop() {
1854   // Stop all concurrent threads. We do this to make sure these threads
1855   // do not continue to execute and access resources (e.g. logging)
1856   // that are destroyed during shutdown.
1857   _cr->stop();
1858   _young_gen_sampling_thread->stop();
1859   _cmThread->stop();
1860   if (G1StringDedup::is_enabled()) {
1861     G1StringDedup::stop();
1862   }
1863 }
1864 
1865 void G1CollectedHeap::safepoint_synchronize_begin() {
1866   SuspendibleThreadSet::synchronize();
1867 }
1868 
1869 void G1CollectedHeap::safepoint_synchronize_end() {
1870   SuspendibleThreadSet::desynchronize();
1871 }
1872 
1873 size_t G1CollectedHeap::conservative_max_heap_alignment() {
1874   return HeapRegion::max_region_size();
1875 }
1876 
1877 void G1CollectedHeap::post_initialize() {
1878   CollectedHeap::post_initialize();
1879   ref_processing_init();
1880 }
1881 
1882 void G1CollectedHeap::ref_processing_init() {
1883   // Reference processing in G1 currently works as follows:
1884   //
1885   // * There are two reference processor instances. One is
1886   //   used to record and process discovered references
1887   //   during concurrent marking; the other is used to
1888   //   record and process references during STW pauses
1889   //   (both full and incremental).
1890   // * Both ref processors need to 'span' the entire heap as
1891   //   the regions in the collection set may be dotted around.
1892   //
1893   // * For the concurrent marking ref processor:
1894   //   * Reference discovery is enabled at initial marking.
1895   //   * Reference discovery is disabled and the discovered
1896   //     references processed etc during remarking.
1897   //   * Reference discovery is MT (see below).
1898   //   * Reference discovery requires a barrier (see below).


< prev index next >